@ -227,8 +227,10 @@ class IOBase:
'closed' property (see below) to test.
"""
if not self.__closed:
self.__closed = True
try:
self.flush()
finally:
def __del__(self) -> None:
"""Destructor. Calls close()."""