diff options
author | Sam James <sam@gentoo.org> | 2023-03-24 05:03:59 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-03-24 05:09:07 +0000 |
commit | 9e9a93ca1c92f22f4ad15ae2e814c81deb1145f8 (patch) | |
tree | 06f25032fb2c21474723d6c5111393620f269200 /dev-python/cython/files | |
parent | dev-perl/Business-ISBN: add 3.8.0 (diff) | |
download | gentoo-9e9a93ca1c92f22f4ad15ae2e814c81deb1145f8.tar.gz gentoo-9e9a93ca1c92f22f4ad15ae2e814c81deb1145f8.tar.bz2 gentoo-9e9a93ca1c92f22f4ad15ae2e814c81deb1145f8.zip |
dev-python/cython: workaround parallel install race for importing pythran
An empty directory in site-packages is a valid Python module, unfortunately, because
of namespaces. If installing packages in parallel, the pythran module might "exist"
but be empty (hence no __version__ attribute). Catch AttributeError to avoid a narrow
race.
This might still be a Portage issue if there's a substantial delay between creating
the directory and installing the remaining files though.
Thanks to Eli Schwartz for helping out.
Bug: https://bugs.gentoo.org/902713
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/cython/files')
-rw-r--r-- | dev-python/cython/files/cython-0.29.23-pythran-parallel-install.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/dev-python/cython/files/cython-0.29.23-pythran-parallel-install.patch b/dev-python/cython/files/cython-0.29.23-pythran-parallel-install.patch new file mode 100644 index 000000000000..450007b5663f --- /dev/null +++ b/dev-python/cython/files/cython-0.29.23-pythran-parallel-install.patch @@ -0,0 +1,20 @@ +An empty directory in site-packages is a valid Python module, unfortunately, because +of namespaces. If installing packages in parallel, the pythran module might "exist" +but be empty (hence no __version__ attribute). Catch AttributeError to avoid a narrow +race. + +See https://bugs.gentoo.org/902713. + +This might still be a Portage issue if there's a substantial delay between creating +the directory and installing the remaining files though. +--- a/Cython/Compiler/Pythran.py ++++ b/Cython/Compiler/Pythran.py +@@ -10,7 +10,7 @@ try: + import pythran + pythran_is_pre_0_9 = tuple(map(int, pythran.__version__.split('.')[0:2])) < (0, 9) + pythran_is_pre_0_9_6 = tuple(map(int, pythran.__version__.split('.')[0:3])) < (0, 9, 6) +-except ImportError: ++except (AttributeError, ImportError): + pythran = None + pythran_is_pre_0_9 = True + pythran_is_pre_0_9_6 = True |