diff options
author | Sam Gross <colesbury@gmail.com> | 2024-01-25 13:27:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-25 10:27:36 -0800 |
commit | b52fc70d1ab3be7866ab71065bae61a03a28bfae (patch) | |
tree | f364d714c70229ad70b6138aac6181d1ee375363 /Lib/gzip.py | |
parent | 4850410b60183dac021ded219a49be140fe5fefe (diff) | |
download | cpython-b52fc70d1ab3be7866ab71065bae61a03a28bfae.tar.gz cpython-b52fc70d1ab3be7866ab71065bae61a03a28bfae.zip |
gh-112529: Implement GC for free-threaded builds (#114262)
* gh-112529: Implement GC for free-threaded builds
This implements a mark and sweep GC for the free-threaded builds of
CPython. The implementation relies on mimalloc to find GC tracked
objects (i.e., "containers").
Diffstat (limited to 'Lib/gzip.py')
-rw-r--r-- | Lib/gzip.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py index 177f9080dc5..fda93e0261e 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -349,7 +349,7 @@ class GzipFile(_compression.BaseStream): def close(self): fileobj = self.fileobj - if fileobj is None: + if fileobj is None or self._buffer.closed: return try: if self.mode == WRITE: |