Skip to content

Commit 67123be

Browse files
eli-schwartznirbheek
authored andcommitted
Revert "Windows: Improve Python 3.8+ module check on Windows"
This reverts commit 99ad11b. This breaks working setups in conda. It is either wrong or incomplete and thus cannot be used. Fixes #10737
1 parent fa99485 commit 67123be

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

mesonbuild/modules/python.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -753,22 +753,10 @@ def find_installation(self, state: 'ModuleState', args: T.Tuple[T.Optional[str]]
753753
found_modules: T.List[str] = []
754754
missing_modules: T.List[str] = []
755755
if python.found() and want_modules:
756-
# Python 3.8.x or later require add_dll_directory() to be called on Windows if
757-
# the needed modules require external DLLs that are not bundled with the modules.
758-
# Simplify things by calling add_dll_directory() on the paths in %PATH%
759-
add_paths_cmd = ''
760-
if hasattr(os, 'add_dll_directory'):
761-
add_paths_cmds = []
762-
paths = os.environ['PATH'].split(os.pathsep)
763-
for path in paths:
764-
if path != '' and os.path.isdir(path):
765-
add_paths_cmds.append(f'os.add_dll_directory({path!r})')
766-
add_paths_cmd = 'import os;' + ';'.join(reversed(add_paths_cmds)) + ';'
767-
768756
for mod in want_modules:
769757
p, *_ = mesonlib.Popen_safe(
770758
python.command +
771-
['-c', f'{add_paths_cmd}import {mod}'])
759+
['-c', f'import {mod}'])
772760
if p.returncode != 0:
773761
missing_modules.append(mod)
774762
else:

0 commit comments

Comments
 (0)