summaryrefslogtreecommitdiff
path: root/odoo/tools/yaml_import.py
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2017-04-11 12:44:29 +0200
committerXavier Morel <xmo@odoo.com>2017-04-11 14:53:29 +0200
commit3979f6802eeea275f949d28ddf4c18f84fc0f5aa (patch)
tree0c67d60c80b2ece2e452837c187a79e9444334d8 /odoo/tools/yaml_import.py
parentca74b5e1c8a48bcdeb396625ec0d8028a5a9d5f1 (diff)
[#8530] convert exception handlers to except..as syntax
Futurize fixers: * lib2to3.fixes.fix_except
Diffstat (limited to 'odoo/tools/yaml_import.py')
-rw-r--r--odoo/tools/yaml_import.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/odoo/tools/yaml_import.py b/odoo/tools/yaml_import.py
index 8e9e1342a70..cefc3667a9e 100644
--- a/odoo/tools/yaml_import.py
+++ b/odoo/tools/yaml_import.py
@@ -227,7 +227,7 @@ class YamlInterpreter(object):
for test in expressions:
try:
success = unsafe_eval(test, self.eval_context, RecordDictWrapper(record))
- except Exception, e:
+ except Exception as e:
_logger.debug('Exception during evaluation of !assert block in yaml_file %s.', self.filename, exc_info=True)
raise YamlImportAbortion(e)
if not success:
@@ -240,12 +240,12 @@ class YamlInterpreter(object):
rmsg = ''
try:
lmsg = unsafe_eval(left, self.eval_context, RecordDictWrapper(record))
- except Exception, e:
+ except Exception as e:
lmsg = '<exc>'
try:
rmsg = unsafe_eval(right, self.eval_context, RecordDictWrapper(record))
- except Exception, e:
+ except Exception as e:
rmsg = '<exc>'
msg += 'values: ! %s %s %s'
@@ -605,11 +605,11 @@ class YamlInterpreter(object):
try:
code_obj = compile(statements, self.filename, 'exec')
unsafe_eval(code_obj, {'ref': self.get_id}, code_context)
- except AssertionError, e:
+ except AssertionError as e:
self._log_assert_failure('AssertionError in Python code %s (line %d): %s',
python.name, python.first_line, e)
return
- except Exception, e:
+ except Exception as e:
_logger.debug('Exception during evaluation of !python block in yaml_file %s.', self.filename, exc_info=True)
raise
else:
@@ -847,7 +847,7 @@ class YamlInterpreter(object):
is_preceded_by_comment = self._log_node(node, is_preceded_by_comment)
try:
self._process_node(node)
- except Exception, e:
+ except Exception as e:
_logger.exception(e)
raise