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:
|
if self._decomp:
|
||||||
self._decomp.CloseDecompressor()
|
self._decomp.CloseDecompressor()
|
||||||
self._decomp = None
|
self._decomp = None
|
||||||
self._file = None
|
self._file.close()
|
||||||
|
|
||||||
def tell(self):
|
def tell(self):
|
||||||
return self._soundpos
|
return self._soundpos
|
||||||
|
@ -734,8 +734,7 @@ class Aifc_write:
|
||||||
self._comp = None
|
self._comp = None
|
||||||
# Prevent ref cycles
|
# Prevent ref cycles
|
||||||
self._convert = None
|
self._convert = None
|
||||||
self._file.flush()
|
self._file.close()
|
||||||
self._file = None
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Internal methods.
|
# Internal methods.
|
||||||
|
|
Loading…
Reference in New Issue