Files
MINGW-packages/mingw-w64-python3/3000-importlib-bootstrap-path-sep.patch
T
Christoph Reiter 6ca69aa8ea python3: fix wrong path separator in module paths with MSYSTEM set
The importlib bootstrap code hardcodes the path separators to use
as well (os.path doesn't exist yet). Check for MSYSTEM there and
adjust the separators.

This makes things like module.__path__ use the same separator in all
places again and for example fixes pytest with MSYSTEM set.

Fixes #6035
2019-12-21 15:04:05 +01:00

15 lines
601 B
Diff

--- Python-3.8.0/Lib/importlib/_bootstrap_external.py.orig 2019-12-21 14:31:23.806479400 +0100
+++ Python-3.8.0/Lib/importlib/_bootstrap_external.py 2019-12-21 14:34:37.093867400 +0100
@@ -1603,6 +1603,11 @@
continue
else:
raise ImportError('importlib requires posix or nt')
+
+ if 'MSYSTEM' in os_module.environ:
+ path_separators = path_separators[::-1]
+ path_sep = path_separators[0]
+
setattr(self_module, '_os', os_module)
setattr(self_module, 'path_sep', path_sep)
setattr(self_module, 'path_separators', ''.join(path_separators))