diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-10-30 10:06:52 +0100 |
---|---|---|
committer | Bernát Gábor <gaborjbernat@gmail.com> | 2018-10-30 09:06:52 +0000 |
commit | 4985ea6a3f4710076c6cd6bd846aee916522015b (patch) | |
tree | af0c70c79236af998c9ec073722553979eefc7c2 | |
parent | a81cf27aab0a15169dc175f2717be2b9e6becfb9 (diff) | |
download | virtualenv-4985ea6a3f4710076c6cd6bd846aee916522015b.tar.gz |
Add check if exec_dir exists before listing it's content (#1199)
install_python() no longer fails if the exec_dir directory doesn't
exist.
Patch source:
https://src.fedoraproject.org/rpms/python-virtualenv/blame/check-exec_dir.patch?identifier=master
Patch added in this Fedora change:
https://src.fedoraproject.org/rpms/python-virtualenv/c/6b9ab1f32bfd159a7b78a34e2c80687b4bc7447c
Co-Authored-By: Michal Cyprian <michal@platform.sh>
-rwxr-xr-x | src/virtualenv.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/virtualenv.py b/src/virtualenv.py index 7e3efa0..e786a31 100755 --- a/src/virtualenv.py +++ b/src/virtualenv.py @@ -1262,8 +1262,9 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy exec_dir = join(sys.exec_prefix, "Lib") else: exec_dir = join(sys.exec_prefix, "lib", py_version) - for fn in os.listdir(exec_dir): - copyfile(join(exec_dir, fn), join(lib_dir, fn), symlink) + if os.path.isdir(exec_dir): + for fn in os.listdir(exec_dir): + copyfile(join(exec_dir, fn), join(lib_dir, fn), symlink) if is_jython: # Jython has either jython-dev.jar and javalib/ dir, or just |