diff options
| author | Julien Castiaux <juc@odoo.com> | 2019-10-22 09:39:24 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-10-22 13:17:03 +0000 |
| commit | 7ef68e4b0e9c4ba3efed2b7625af8e379b4f1683 (patch) | |
| tree | 0587354e0cc8de5ce8c4f236149ea6ef0d42b23c /odoo/__init__.py | |
| parent | 54df22c112916cf6ddee8acd97db9fd537c9cfaa (diff) | |
[FIX] core: using absolute paths
Start odoo-bin using a tier module (like `python3 -m pdb odoo-bin`), the
odoo/addons __path__ contains the relative link to the modules instead
of the absolute link like when directly started (`python3 odoo-bin`).
This cause trouble importing modules because it reuses the relative path
from within other directories.
closes odoo/odoo#39182
X-original-commit: 941e051fc6b33e7a90400c77d63d589049b027a6
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Diffstat (limited to 'odoo/__init__.py')
| -rw-r--r-- | odoo/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/odoo/__init__.py b/odoo/__init__.py index 30da3608237..8eb764a712d 100644 --- a/odoo/__init__.py +++ b/odoo/__init__.py @@ -8,7 +8,12 @@ # odoo must be a namespace package for odoo.addons to become one too # https://packaging.python.org/guides/packaging-namespace-packages/ #---------------------------------------------------------- -__path__ = __import__('pkgutil').extend_path(__path__, __name__) +import pkgutil +import os.path +__path__ = [ + os.path.abspath(path) + for path in pkgutil.extend_path(__path__, __name__) +] import sys assert sys.version_info > (3, 6), "Outdated python version detected, Odoo requires Python >= 3.6 to run." |
