-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-132775: Add _PyPickle_GetXIData() #133107
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
gh-132775: Add _PyPickle_GetXIData() #133107
Conversation
🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit 15ecef1 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133107%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Lib/test/support/import_helper.py
Outdated
@contextlib.contextmanager | ||
def module_restored(name): | ||
"""A context manager that restores a module to the original state.""" | ||
missing = name in sys.modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't missing
be name not in sys.modules
? (or renamed to present
)?
also, is it different than orig is not None
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it should be "not" in sys.modules. Good catch.
It is different from orig is not None
since None
could be set in sys.modules. I could use a temporary sentinel for that, I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There's some extra complexity due to making sure we we get things right when handling functions and classes defined in the
__main__
module. This is also reflected in the tests, including the addition of extra functions in test.support.import_helper.