(self, f)
| 277 | raise Error('fmt chunk and/or data chunk missing') |
| 278 | |
| 279 | def __init__(self, f): |
| 280 | self._i_opened_the_file = None |
| 281 | if isinstance(f, str): |
| 282 | f = builtins.open(f, 'rb') |
| 283 | self._i_opened_the_file = f |
| 284 | # else, assume it is an open file object already |
| 285 | try: |
| 286 | self.initfp(f) |
| 287 | except: |
| 288 | if self._i_opened_the_file: |
| 289 | f.close() |
| 290 | raise |
| 291 | |
| 292 | def __del__(self): |
| 293 | self.close() |
nothing calls this directly
no test coverage detected