-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-24048: Save the live exception during import.c's remove_module() #13005
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
bpo-24048: Save the live exception during import.c's remove_module() #13005
Conversation
Save the live exception during the course of remove_module().
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.
LGTM. But maybe the NEWS entry to explain what was the problem rathe than explaining the fix.
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.
LGTM.
Any reason you didn't merge, @vstinner ? |
if (PyMapping_DelItem(modules, name) < 0) { | ||
if (!PyMapping_HasKey(modules, name)) { | ||
return; | ||
} | ||
Py_FatalError("import: deleting existing key in " | ||
"sys.modules failed"); |
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.
By the way, it would be nice to chain the two exceptions rather than calling the nasty Py_FatalError() function :-(
Thanks @ZackerySpytz for the PR, and @ncoghlan for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Thanks @ZackerySpytz for the PR, and @ncoghlan for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
Thanks @ZackerySpytz for the PR, and @ncoghlan for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
GH-20521 is a backport of this pull request to the 3.7 branch. |
Sorry, @ZackerySpytz and @ncoghlan, I could not cleanly backport this to |
Sorry @ZackerySpytz and @ncoghlan, I had trouble checking out the |
…ythonGH-13005) Save the live exception during the course of remove_module(). (cherry picked from commit 94a64e9) Co-authored-by: Zackery Spytz <[email protected]>
…H-13005) Save the live exception during the course of remove_module(). (cherry picked from commit 94a64e9) Co-authored-by: Zackery Spytz <[email protected]>
|
Save the live exception during the course of remove_module().
https://bugs.python.org/issue24048