mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-03 06:49:10 -07:00
Change exceptions to python3 syntax.
This commit is contained in:
parent
62c08d96e5
commit
6747f82547
22 changed files with 38 additions and 38 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue