Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
Fix setup_atomic_replace.py for win32/py2
Browse files Browse the repository at this point in the history
  • Loading branch information
havocp committed Jun 7, 2016
1 parent 1343873 commit d1910ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setup_atomic_replace.py
Expand Up @@ -17,8 +17,9 @@
def _rename_over_existing(src, dest):
try:
# On Windows, this will throw EEXIST, on Linux it won't.
# on Win32/Py2 it throws OSError instead of IOError
os.rename(src, dest)
except IOError as e:
except (OSError, IOError) as e:
if e.errno == errno.EEXIST:
# Clearly this song-and-dance is not in fact atomic,
# but if something goes wrong putting the new file in
Expand Down

0 comments on commit d1910ef

Please sign in to comment.