summaryrefslogtreecommitdiff
path: root/lang/python/python3/patches/008-fix-distutils-path-creation.patch
blob: 8db6bdc811f16862e7a53d83c5caf58f2d3a1d66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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))