diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-08-25 17:41:38 -0400 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2022-09-02 13:48:40 +0530 |
commit | 4bc0aaae37f2857b0688010114f188f53767e4ce (patch) | |
tree | 879912c3244d424c8e328921ab5ae194ede2a9d7 | |
parent | 4ac68bed5cad1fe9a366b3d3afcbc4a256a96ea4 (diff) | |
download | meson-4bc0aaae37f2857b0688010114f188f53767e4ce.zip meson-4bc0aaae37f2857b0688010114f188f53767e4ce.tar.gz meson-4bc0aaae37f2857b0688010114f188f53767e4ce.tar.bz2 |
Revert "Windows: Improve Python 3.8+ module check on Windows"
This reverts commit 99ad11bd9c3249f548dda0b275d9f8dd1b3f6d14.
This breaks working setups in conda. It is either wrong or incomplete
and thus cannot be used.
Fixes #10737
-rw-r--r-- | mesonbuild/modules/python.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 47dc674..fcf3d3e 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -753,22 +753,10 @@ class PythonModule(ExtensionModule): found_modules: T.List[str] = [] missing_modules: T.List[str] = [] if python.found() and want_modules: - # Python 3.8.x or later require add_dll_directory() to be called on Windows if - # the needed modules require external DLLs that are not bundled with the modules. - # Simplify things by calling add_dll_directory() on the paths in %PATH% - add_paths_cmd = '' - if hasattr(os, 'add_dll_directory'): - add_paths_cmds = [] - paths = os.environ['PATH'].split(os.pathsep) - for path in paths: - if path != '' and os.path.isdir(path): - add_paths_cmds.append(f'os.add_dll_directory({path!r})') - add_paths_cmd = 'import os;' + ';'.join(reversed(add_paths_cmds)) + ';' - for mod in want_modules: p, *_ = mesonlib.Popen_safe( python.command + - ['-c', f'{add_paths_cmd}import {mod}']) + ['-c', f'import {mod}']) if p.returncode != 0: missing_modules.append(mod) else: |