mirror of https://github.com/python/cpython
actually close files instead of leaving it to the gc #5955
This commit is contained in:
parent
dd26681155
commit
0258811125
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue