Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/mathlib.py
diff options
context:
space:
mode:
authorReinier Heeres <reinier@heeres.eu>2007-09-16 21:25:59 (GMT)
committer Reinier Heeres <reinier@heeres.eu>2007-09-16 21:25:59 (GMT)
commitdbf0042e81535529026aa94d0fe158809a3c054c (patch)
tree6dfa28517ab99fec38bc90441ddb68c1110cc04f /mathlib.py
parentd3a7798fbd50c43cc70787483be0cdde42876e13 (diff)
Function exceptions get caught.
Diffstat (limited to 'mathlib.py')
-rw-r--r--mathlib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mathlib.py b/mathlib.py
index 91e57fe..e9dffb9 100644
--- a/mathlib.py
+++ b/mathlib.py
@@ -68,7 +68,11 @@ class MathLib:
return d.normalize()
def parse_number(self, s):
- return Decimal(s)
+ try:
+ d = Decimal(s)
+ return Decimal(s)
+ except Exception, inst:
+ return None
def format_number(self, n):
if type(n) is types.BooleanType: