Merge pull request #6818 from blueyed/fix-assert-exc-upstream

assertion: rewrite: only catch EnvironmentError
This commit is contained in:
Ran Benita 2020-03-27 18:33:17 +03:00 committed by GitHub
commit 83e18776f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -285,7 +285,7 @@ if sys.platform == "win32":
with atomic_write(fspath(pyc), mode="wb", overwrite=True) as fp:
_write_pyc_fp(fp, source_stat, co)
except EnvironmentError as e:
state.trace("error writing pyc file at {}: errno={}".format(pyc, e.errno))
state.trace("error writing pyc file at {}: {}".format(pyc, e))
# we ignore any failure to write the cache file
# there are many reasons, permission-denied, pycache dir being a
# file etc.
@ -308,8 +308,8 @@ else:
try:
_write_pyc_fp(fp, source_stat, co)
os.rename(proc_pyc, fspath(pyc))
except BaseException as e:
state.trace("error writing pyc file at {}: errno={}".format(pyc, e.errno))
except EnvironmentError as e:
state.trace("error writing pyc file at {}: {}".format(pyc, e))
# we ignore any failure to write the cache file
# there are many reasons, permission-denied, pycache dir being a
# file etc.