summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/trytond-add-guix_trytond_path.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/trytond-add-guix_trytond_path.patch')
-rw-r--r--gnu/packages/patches/trytond-add-guix_trytond_path.patch19
1 files changed, 8 insertions, 11 deletions
diff --git a/gnu/packages/patches/trytond-add-guix_trytond_path.patch b/gnu/packages/patches/trytond-add-guix_trytond_path.patch
index 7dc136ec46..de4b0a1d36 100644
--- a/gnu/packages/patches/trytond-add-guix_trytond_path.patch
+++ b/gnu/packages/patches/trytond-add-guix_trytond_path.patch
@@ -1,24 +1,21 @@
Make trytond add all paths listed in GUIX_TRYTOND_MODULES_PATH to sys.path.
-*** a/trytond/modules/__init__.py 1970-01-01 01:00:01.000000000 +0100
---- b/trytond/modules/__init__.py 2021-12-02 22:17:28.014612267 +0100
+*** a/trytond/modules/__init__.py
+--- b/trytond/modules/__init__.py
***************
*** 31,36 ****
---- 31,48 ----
+--- 31,45 ----
EGG_MODULES = {}
+ def __extend_python_path__():
-+ tryton_python_path = os.environ.get("GUIX_TRYTOND_MODULES_PATH")
-+ if tryton_python_path:
-+ paths = [path[:-16] # remove "/trytond/modules"
-+ for path in tryton_python_path.split(os.pathsep)]
-+ sys.path.extend(paths)
-+ # ensure new paths are in the pkg_resources WorkingSet
-+ import pkg_resources
-+ list(map(pkg_resources.working_set.add_entry, paths))
++ trytond_modules_path = os.environ.get("GUIX_TRYTOND_MODULES_PATH")
++ if trytond_modules_path:
++ # make tryton.module behave like a namespace package
++ __path__.extend(trytond_modules_path.split(os.pathsep))
+
+ __extend_python_path__()
++ del __extend_python_path__
+
def update_egg_modules():