Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Reader/Writer to be context managers #311

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove enter/exit from Writer
not necessary because they will be inherited
esrice authored Sep 13, 2024
commit 87026b93cf1ee8c965c8ef0ce8c6970b3f782f6b
6 changes: 0 additions & 6 deletions cyvcf2/cyvcf2.pyx
Original file line number Diff line number Diff line change
@@ -2420,12 +2420,6 @@ cdef class Writer(VCF):
bcf_hdr_sync(self.hdr)
self.header_written = False

def __enter__(self):
return self

def __exit__(self, type, value, tb):
self.close()

@staticmethod
def _infer_file_mode(fname, mode=None):
if mode is not None: