Skip to content

Commit

Permalink
Avoid using exist_ok parameter
Browse files Browse the repository at this point in the history
Not present on Python 3.4

Closes gh-118
  • Loading branch information
takluyver committed May 24, 2017
1 parent 0e507b8 commit 51b05bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nsist/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 51b05bd

Please sign in to comment.