[#8530] convert exception handlers to except..as syntax

Futurize fixers:
* lib2to3.fixes.fix_except
This commit is contained in:
Xavier Morel
2017-04-11 14:53:29 +02:00
parent ca74b5e1c8
commit 3979f6802e
53 changed files with 209 additions and 121 deletions
+2 -2
View File
@@ -373,7 +373,7 @@ def load_openerp_module(module_name):
if info['post_load']:
getattr(sys.modules['odoo.addons.' + module_name], info['post_load'])()
except Exception, e:
except Exception as e:
msg = "Couldn't load module %s" % (module_name)
_logger.critical(msg)
_logger.critical(e)
@@ -427,7 +427,7 @@ def get_test_modules(module):
modpath = 'odoo.addons.' + module
try:
mod = importlib.import_module('.tests', modpath)
except Exception, e:
except Exception as e:
# If module has no `tests` sub-module, no problem.
if str(e) != 'No module named tests':
_logger.exception('Can not `import %s`.', module)