Use more verbose exception catch.

This commit is contained in:
Jacob Hoffman-Andrews 2015-05-22 13:16:55 -07:00
parent 8562496f82
commit 1a5d6ba90d

View file

@ -70,7 +70,7 @@ def unique_file(path, mode=0o777):
try:
file_d = os.open(fname, os.O_CREAT | os.O_EXCL | os.O_RDWR, mode)
return os.fdopen(file_d, "w"), fname
except OSError, e:
except OSError as exception:
# "File exists," is okay, try a different name.
if exception.errno != errno.EEXIST:
raise