Start and (if successfully written) close the file.
(fname, id_=None, *, overwrite=True)
| 313 | |
| 314 | @contextmanager |
| 315 | def start_and_end_file(fname, id_=None, *, overwrite=True): |
| 316 | """Start and (if successfully written) close the file.""" |
| 317 | with start_file(fname, id_=id_, overwrite=overwrite) as fid: |
| 318 | yield fid |
| 319 | end_file(fid) # we only hit this line if the yield does not err |
| 320 | |
| 321 | |
| 322 | def check_fiff_length(fid, close=True): |
no test coverage detected