Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add context manager protocol for .NET IDisposable types#2568

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
den-run-ai wants to merge4 commits intopythonnet:master
base:master
Choose a base branch
Loading
fromden-run-ai:feature/context-manager-disposable

Conversation

@den-run-ai
Copy link
Contributor

What does this implement/fix? Explain your changes.

Implemented IDisposable based on this discussion:
#79

@microsoft-github-policy-service agree

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Ensure you have signed the.NET Foundation CLA
  • Add yourself toAUTHORS
  • Updated theCHANGELOG

michaelblyons reacted with rocket emoji
@lostmsu
Copy link
Member

lostmsu commentedMar 24, 2025
edited
Loading

FYI: tests are not passing

@den-run-ai
Copy link
ContributorAuthor

This seems not related to this PR@lostmsu

i tested on mac with .net 8

@lostmsu
Copy link
Member

@den-run-ai This is definitely related to PR, master does not seem to be failing these tests.

@michaelblyons
Copy link

For anyone else who is annoyed that the test failures do not provoke backtraces on GitHub's UI,1 here is the output:

_______________________ test_import_all_on_second_time ________________________    def test_import_all_on_second_time():        """Test import all attributes after a normal import without '*'.        Due to import * only allowed at module level, the test body splitted        to a module file.""">       from . import importtesttests\test_import.py:20: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    import sys    try:        del sys.modules["System.IO"]    except KeyError:        pass        assert "FileStream" not in globals()    import System.IO    from System.IO import *    >   assert "FileStream" in globals()E   AssertionErrortests\importtest.py:13: AssertionError

My (uninitiated) interpretation is that some cruft is left hanging around despite theDispose() call.

Footnotes

  1. And also lest the test artefacts age away.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@den-run-ai@lostmsu@michaelblyons@filmor

[8]ページ先頭

©2009-2025 Movatter.jp