diff options
author | Reinier Heeres <rwh@rwh.(none)> | 2008-03-13 07:31:13 (GMT) |
---|---|---|
committer | Reinier Heeres <rwh@rwh.(none)> | 2008-03-13 07:31:13 (GMT) |
commit | 8d64d856acdcedc3b193a2ccc671d8b4d8e7d951 (patch) | |
tree | 6acb6132100889017610f7cc29ba4ad214bda3e3 | |
parent | b593767cc0ab04f2ef3be72ec25a1a180ce682b9 (diff) |
Fix insert of answer when not defined
-rw-r--r-- | calculate.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/calculate.py b/calculate.py index 0e1512f..049cc34 100644 --- a/calculate.py +++ b/calculate.py @@ -808,10 +808,11 @@ class Calculate(activity.Activity): def format_insert_ans(self): ans = self.parser.get_var('Ans') if isinstance(ans, Rational): - ansstr = str(ans) + return str(ans) + elif ans is not None: + return self.ml.format_number(ans) else: - ansstr = self.ml.format_number(ans) - return ansstr + return '' def main(): win = gtk.Window(gtk.WINDOW_TOPLEVEL) |