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

This commit is contained in:
Antoine Pitrou 2012-08-30 00:30:14 +02:00
commit 2a021c80ce

View file

@ -670,9 +670,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__':