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

Commits on Sep 13, 2024

  1. Allow Reader/Writer to be context managers

    By adding __enter__ and __exit__ methods to the Reader and Writer
    classes, they can now be used as context managers. Also added a test to
    make sure the Reader context manager works correctly. Did not add a test
    to do the same with Writer, because trying to write to a closed Writer
    results in a segfault rather than raising an exception that can be
    checked by pytest.
    esrice committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    dad1596 View commit details
    Browse the repository at this point in the history
  2. Remove enter/exit from Writer

    not necessary because they will be inherited
    esrice authored Sep 13, 2024
    Configuration menu
    Copy the full SHA
    87026b9 View commit details
    Browse the repository at this point in the history