Skip to content

Commit

Permalink
Issue python#15800: fix the closing of input / output files when gzip…
Browse files Browse the repository at this point in the history
… is used as a script.
  • Loading branch information
pitrou committed Aug 29, 2012
1 parent 49ccd51 commit ecc4757
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/gzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down

0 comments on commit ecc4757

Please sign in to comment.