diff markup/eval.py @ 90:242610137d1f

When an expression evaluates to a callable, it is called implicitly.
author cmlenz
date Wed, 19 Jul 2006 17:50:17 +0000
parents 9ecae580dd93
children bc73d3ab823f
line wrap: on
line diff
--- a/markup/eval.py
+++ b/markup/eval.py
@@ -82,7 +82,10 @@
         @param data: a mapping containing the data to evaluate against
         @return: the result of the evaluation
         """
-        return eval(self.code)
+        retval = eval(self.code)
+        if callable(retval):
+            retval = retval()
+        return retval
 
     def _compile(self, source, filename, lineno):
         tree = parse(self.source, 'eval')
Copyright (C) 2012-2017 Edgewall Software