flake8: fix bare except clause

This commit is contained in:
jradtilbrook 2017-11-04 19:57:45 +08:00
parent b2d32f0702
commit 257c42e111
No known key found for this signature in database
GPG Key ID: 0A336FAEEE507041

View File

@ -34,7 +34,7 @@ def replace(path, mode='w+b', encoding=None, errors=None):
(fd, tempname) = tempfile.mkstemp(dir=os.path.dirname(path))
try:
fp = io.open(fd, mode, encoding=encoding, errors=errors)
except:
except Exception:
os.remove(tempname)
os.close(fd)
raise
@ -43,7 +43,7 @@ def replace(path, mode='w+b', encoding=None, errors=None):
fp.flush()
os.fsync(fd)
os.rename(tempname, path)
except:
except Exception:
os.remove(tempname)
raise
finally: