Flush and close the IO object. This method has no effect if the file is already closed.
(self)
| 410 | __closed = False |
| 411 | |
| 412 | def close(self): |
| 413 | """Flush and close the IO object. |
| 414 | |
| 415 | This method has no effect if the file is already closed. |
| 416 | """ |
| 417 | if not self.__closed: |
| 418 | try: |
| 419 | self.flush() |
| 420 | finally: |
| 421 | self.__closed = True |
| 422 | |
| 423 | def __del__(self): |
| 424 | """Destructor. Calls close().""" |