Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tautils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tautils.py b/tautils.py
index a0361e8..12812db 100644
--- a/tautils.py
+++ b/tautils.py
@@ -41,6 +41,11 @@ from StringIO import StringIO
import os.path
from gettext import gettext as _
+class logoerror(Exception):
+ def __init__(self, value):
+ self.value = value
+ def __str__(self):
+ return repr(self.value)
'''
The strategy for mixing numbers and strings is to first try
@@ -241,6 +246,11 @@ def text_media_type(name):
def round_int(num):
""" Remove trailing decimal places if number is an int """
+ try:
+ float(num)
+ except TypeError:
+ raise logoerror("#syntaxerror")
+
if int(float(num)) == num:
return int(num)
else: