diff options
author | reksarka <reksarka@gmail.com> | 2022-06-29 03:10:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 01:10:53 +0100 |
commit | 245cae75ecbefd9fa815633a2b8dedb9b403d0f0 (patch) | |
tree | 69bf0e7ee1ca89a3b2e2df7a7d02d11ecc149321 /src | |
parent | 3cd93e1662cdd03ebeb48da0cb570d69fb81a752 (diff) | |
download | virtualenv-245cae75ecbefd9fa815633a2b8dedb9b403d0f0.tar.gz |
Ignores missing DLLs dir in CPython3Windows (#2369)
Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
Co-authored-by: Lumír 'Frenzy' Balhar <lbalhar@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/virtualenv/create/via_global_ref/builtin/cpython/cpython3.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/virtualenv/create/via_global_ref/builtin/cpython/cpython3.py b/src/virtualenv/create/via_global_ref/builtin/cpython/cpython3.py index 3bbc494..03d3097 100644 --- a/src/virtualenv/create/via_global_ref/builtin/cpython/cpython3.py +++ b/src/virtualenv/create/via_global_ref/builtin/cpython/cpython3.py @@ -92,9 +92,15 @@ class CPython3Windows(CPythonWindows, CPython3): @classmethod def dll_and_pyd(cls, interpreter): + folders = [Path(interpreter.system_executable).parent] + + # May be missing on some Python hosts. + # See https://github.com/pypa/virtualenv/issues/2368 dll_folder = Path(interpreter.system_prefix) / "DLLs" - host_exe_folder = Path(interpreter.system_executable).parent - for folder in [host_exe_folder, dll_folder]: + if dll_folder.is_dir(): + folders.append(dll_folder) + + for folder in folders: for file in folder.iterdir(): if file.suffix in (".pyd", ".dll"): yield PathRefToDest(file, cls.to_bin) |