Commit ecc4757b authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #15800: fix the closing of input / output files when gzip is used as a script.

parent 49ccd514
...@@ -621,9 +621,9 @@ def _test(): ...@@ -621,9 +621,9 @@ def _test():
if not chunk: if not chunk:
break break
g.write(chunk) g.write(chunk)
if g is not sys.stdout: if g is not sys.stdout.buffer:
g.close() g.close()
if f is not sys.stdin: if f is not sys.stdin.buffer:
f.close() f.close()
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment