Make log_error actually return a value.
authorMatthijs Kooijman <matthijs@stdin.nl>
Sun, 1 Feb 2009 17:58:06 +0000 (18:58 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Sun, 1 Feb 2009 17:58:06 +0000 (18:58 +0100)
When no error occured, log_error would not pass on the actual value
produced by the decorated function.

tools/misc.py

index 1259ab7d706284e6abc2164e79d6d90cdbe50143..ba84f05e87141c0be4a9e2efd14bdf1d906dbc1d 100644 (file)
@@ -22,7 +22,7 @@ prints it to stdout and raises it again.
 def log_error(func):
     def show(*args, **kwargs):
         try:
-            func(*args, **kwargs)
+            return func(*args, **kwargs)
         except Exception, e:
             import traceback
             traceback.print_exc()