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

bpo-41993: Fix possible issues in remove_module() #22631

Merged
merged 3 commits into from
Oct 11, 2020
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
Update comment.
  • Loading branch information
serhiy-storchaka committed Oct 11, 2020
commit 39b3e68c04d7288b19e2b1f9be9d0033ea968dd9
6 changes: 5 additions & 1 deletion Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,11 @@ PyImport_AddModule(const char *name)
}


/* Remove name from sys.modules, if it's there. */
/* Remove name from sys.modules, if it's there.
* Can be called with an exception raised.
* If fail to remove name a new exception will be chained with the old
* exception, otherwise the old exception is preserved.
*/
static void
remove_module(PyThreadState *tstate, PyObject *name)
{
Expand Down