瀏覽代碼

Avoid using exist_ok parameter

Not present on Python 3.4

Closes gh-118
Thomas Kluyver 8 年之前
父節點
當前提交
51b05bda58
共有 1 個文件被更改,包括 5 次插入1 次删除
  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))