Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f4e8ca

Browse files
committed
Correct previous patch looking for warnings module: sys.modules, not
sys.__modules__.
1 parent b233e54 commit 5f4e8ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/pythonrun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ PyObject *PyModule_GetWarningsModule()
9292
/* Save and restore any exceptions */
9393
PyErr_Fetch(&typ, &val, &tb);
9494

95-
all_modules = PySys_GetObject("__modules__");
95+
all_modules = PySys_GetObject("modules");
9696
if (all_modules) {
9797
warnings_module = PyDict_GetItemString(all_modules, "warnings");
9898
/* We keep a ref in the global */

0 commit comments

Comments
 (0)