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
15 lines
601 B
Diff
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))
|