]> granicus.if.org Git - python/commitdiff
actually close files instead of leaving it to the gc #5955
authorBenjamin Peterson <benjamin@python.org>
Thu, 7 May 2009 11:45:38 +0000 (11:45 +0000)
committerBenjamin Peterson <benjamin@python.org>
Thu, 7 May 2009 11:45:38 +0000 (11:45 +0000)
Lib/aifc.py

index f9db3f483555e23aaa9cf6093903070b343cd225..197e755210f652998e16ee7eca197ac217731e6d 100644 (file)
@@ -347,7 +347,7 @@ class Aifc_read:
         if self._decomp:
             self._decomp.CloseDecompressor()
             self._decomp = None
-        self._file = None
+        self._file.close()
 
     def tell(self):
         return self._soundpos
@@ -734,8 +734,7 @@ class Aifc_write:
             self._comp = None
         # Prevent ref cycles
         self._convert = None
-        self._file.flush()
-        self._file = None
+        self._file.close()
 
     #
     # Internal methods.