]> granicus.if.org Git - python/commitdiff
Fix test_gzip failure on OS X. The failure was a result of trying to fflush
authorMark Dickinson <dickinsm@gmail.com>
Tue, 4 May 2010 18:45:27 +0000 (18:45 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Tue, 4 May 2010 18:45:27 +0000 (18:45 +0000)
a file that wasn't open for writing.  Patch by Antoine Pitrou.

Lib/gzip.py

index 13f2ca24b77ec10f3084ceb0183bb511f0fd60b0..5fc7639f56fbdf82491625ae12d96548e965f738 100644 (file)
@@ -362,7 +362,7 @@ class GzipFile(io.BufferedIOBase):
         if self.mode == WRITE:
             # Ensure the compressor's buffer is flushed
             self.fileobj.write(self.compress.flush(zlib_mode))
-        self.fileobj.flush()
+            self.fileobj.flush()
 
     def fileno(self):
         """Invoke the underlying file object's fileno() method.