Change exceptions to python3 syntax.

This commit is contained in:
ian 2015-04-13 12:35:20 -04:00
parent 62c08d96e5
commit 6747f82547
22 changed files with 38 additions and 38 deletions

View file

@ -105,13 +105,13 @@ def safe_eval(expr, locals={}, include_exceptions=False):
return (result, None)
else:
return result
except SyntaxError, e:
except SyntaxError as e:
# special handling for syntax errors, we just return
# the expression string back as-is
if include_exceptions:
return (expr, None)
return expr
except Exception, e:
except Exception as e:
if include_exceptions:
return (expr, e)
return expr