summaryrefslogtreecommitdiff
path: root/odoo/modules/module.py
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2018-11-08 15:03:33 +0000
committerAdrian Torres <adt@odoo.com>2018-11-29 09:28:17 +0000
commit758382b3a73da024d6e1dc04a474d2868223767a (patch)
treee37ea57fb6efabf9a14d30b39a74af664ddd1ed3 /odoo/modules/module.py
parent52f5528cfb6d1152ee226e268247dc685a8ba329 (diff)
[REM] pycompat: remove python 2 shims and helpers
Odoo no longer supports python 2, thus some of these helpers can and have been replaced by python 3 built-ins, therefore there is no need for them to stay defined. The removed helpers are: * izip, imap and ifilter * unichr, text_type * implements_to_string, implements_iterator * string_types, integer_types * to_native The python 2 shims have also been removed, and only the python 3 helpers have been kept, because they can still be usable (i.e. accepting both bytes and str for functions that can only accept one of the two) [REM] pyjsparser: remove PY3 shims They're no longer necessary as Odoo doesn't officially support python 2 anymore. closes odoo/odoo#28519
Diffstat (limited to 'odoo/modules/module.py')
-rw-r--r--odoo/modules/module.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/odoo/modules/module.py b/odoo/modules/module.py
index 4f7f80ca396..c94df025f9b 100644
--- a/odoo/modules/module.py
+++ b/odoo/modules/module.py
@@ -434,12 +434,8 @@ def get_test_modules(module):
mod = importlib.import_module('.tests', modpath)
except ImportError as e: # will also catch subclass ModuleNotFoundError of P3.6
# Hide ImportErrors on `tests` sub-module, but display other exceptions
- if pycompat.PY2:
- if e.message.startswith('No module named') and e.message.endswith("tests"):
- return []
- else:
- if e.name == modpath + '.tests' and e.msg.startswith('No module named'):
- return []
+ if e.name == modpath + '.tests' and e.msg.startswith('No module named'):
+ return []
_logger.exception('Can not `import %s`.', module)
return []
except Exception as e: