Pārlūkot izejas kodu

Avoid using exist_ok parameter

Not present on Python 3.4

Closes gh-118
Thomas Kluyver 8 gadi atpakaļ
vecāks
revīzija
51b05bda58
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5 1
      nsist/pypi.py

+ 5 - 1
nsist/pypi.py

@@ -186,7 +186,11 @@ def extract_wheel(whl_file, target_dir):
             if p.is_dir():
                 # If the dst directory already exists, this will combine them.
                 # shutil.copytree will not combine them.
-                target.joinpath(p.name).mkdir(exist_ok = True)
+                try:
+                    target.joinpath(p.name).mkdir()
+                except OSError as e:
+                    if e.errno != errno.EEXIST:
+                        raise
                 merge_dir_to(p, target / p.name)
             else:
                 shutil.copy2(str(p), str(target))