aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2017-06-17 09:22:58 +0300
committerGitHub <noreply@github.com>2017-06-17 09:22:58 +0300
commitc1bf9a750ddf61a5c561c1f7d1aebd17665cbf03 (patch)
treed6230f4601159a208fb50514d487bf0428fa0d58
parentfcd25932bfc3028b770476c0e25df5a198a4862b (diff)
parent576c45eb0a5314121aeb2f8d8931644b65e5be99 (diff)
Merge pull request #4475 from commodo/fix-distutils-import
python3: fix distutils path to package when using bytecodes
-rw-r--r--lang/python/python3/Makefile2
-rw-r--r--lang/python/python3/patches/008-fix-distutils-path-creation.patch16
2 files changed, 17 insertions, 1 deletions
diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile
index 97c0f6efe..5438a3ca7 100644
--- a/lang/python/python3/Makefile
+++ b/lang/python/python3/Makefile
@@ -14,7 +14,7 @@ PYTHON_VERSION:=$(PYTHON3_VERSION)
PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
PKG_NAME:=python3
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
diff --git a/lang/python/python3/patches/008-fix-distutils-path-creation.patch b/lang/python/python3/patches/008-fix-distutils-path-creation.patch
new file mode 100644
index 000000000..8db6bdc81
--- /dev/null
+++ b/lang/python/python3/patches/008-fix-distutils-path-creation.patch
@@ -0,0 +1,16 @@
+diff --git a/Lib/imp.py b/Lib/imp.py
+index 781ff23..beeac70 100644
+--- a/Lib/imp.py
++++ b/Lib/imp.py
+@@ -203,8 +203,9 @@ def load_package(name, path):
+ extensions = (machinery.SOURCE_SUFFIXES[:] +
+ machinery.BYTECODE_SUFFIXES[:])
+ for extension in extensions:
+- path = os.path.join(path, '__init__'+extension)
+- if os.path.exists(path):
++ init_path = os.path.join(path, '__init__'+extension)
++ if os.path.exists(init_path):
++ path = init_path
+ break
+ else:
+ raise ValueError('{!r} is not a package'.format(path))