(self, f)
| 420 | """ |
| 421 | |
| 422 | def __init__(self, f): |
| 423 | self._i_opened_the_file = None |
| 424 | if isinstance(f, str): |
| 425 | f = builtins.open(f, 'wb') |
| 426 | self._i_opened_the_file = f |
| 427 | try: |
| 428 | self.initfp(f) |
| 429 | except: |
| 430 | if self._i_opened_the_file: |
| 431 | f.close() |
| 432 | raise |
| 433 | |
| 434 | def initfp(self, file): |
| 435 | self._file = file |