Merge pull request #3574 from jdufresne/base-exc

Catch BaseException for resource cleanup handlers
This commit is contained in:
Hugo 2019-02-03 11:35:44 +02:00 committed by GitHub
commit 4d1a459fa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2663,7 +2663,7 @@ def open(fp, mode="r"):
# opening failures that are entirely expected.
# logger.debug("", exc_info=True)
continue
except Exception:
except BaseException:
if exclusive_fp:
fp.close()
raise