diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-30 00:29:24 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-30 00:29:24 +0200 |
commit | e49326fe1371d442b7119ad92b3d4ffa4005e621 (patch) | |
tree | 18260644971d1108f872feebc33de1b4d2591bed /Lib/gzip.py | |
parent | 496df8a58e64375b00950b9ad27a5b91a8e0ca44 (diff) | |
download | cpython-e49326fe1371d442b7119ad92b3d4ffa4005e621.tar.gz |
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.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py index ee45e50ffb..e1b43a5598 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__': |