(self, f)
| 352 | raise Error('COMM chunk and/or SSND chunk missing') |
| 353 | |
| 354 | def __init__(self, f): |
| 355 | if isinstance(f, str): |
| 356 | file_object = builtins.open(f, 'rb') |
| 357 | try: |
| 358 | self.initfp(file_object) |
| 359 | except: |
| 360 | file_object.close() |
| 361 | raise |
| 362 | else: |
| 363 | # assume it is an open file object already |
| 364 | self.initfp(f) |
| 365 | |
| 366 | def __enter__(self): |
| 367 | return self |