summaryrefslogtreecommitdiffstats
path: root/Lib/gzip.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-08-29 22:29:24 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-08-29 22:29:24 (GMT)
commitecc4757b79c7d8f7b09fbc2e8b24258c22cfed12 (patch)
treea9fc8a0061ae82c0632600cea1847024ff8195e8 /Lib/gzip.py
parent49ccd514d2e29048062a3a669fed98329807c765 (diff)
downloadcpython-ecc4757b79c7d8f7b09fbc2e8b24258c22cfed12.zip
cpython-ecc4757b79c7d8f7b09fbc2e8b24258c22cfed12.tar.gz
cpython-ecc4757b79c7d8f7b09fbc2e8b24258c22cfed12.tar.bz2
Issue #15800: fix the closing of input / output files when gzip is used as a script.
Diffstat (limited to 'Lib/gzip.py')
-rw-r--r--Lib/gzip.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py
index ee45e50..e1b43a5 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -621,9 +621,9 @@ def _test():
if not chunk:
break
g.write(chunk)
- if g is not sys.stdout:
+ if g is not sys.stdout.buffer:
g.close()
- if f is not sys.stdin:
+ if f is not sys.stdin.buffer:
f.close()
if __name__ == '__main__':