mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
This commit is contained in:
parent
13ad3b7a82
commit
93c92f7d1d
21 changed files with 154 additions and 308 deletions
|
|
@ -3902,6 +3902,7 @@ import_copyreg(void)
|
|||
{
|
||||
PyObject *copyreg_str;
|
||||
PyObject *copyreg_module;
|
||||
PyInterpreterState *interp = PyThreadState_GET()->interp;
|
||||
_Py_IDENTIFIER(copyreg);
|
||||
|
||||
copyreg_str = _PyUnicode_FromId(&PyId_copyreg);
|
||||
|
|
@ -3913,7 +3914,7 @@ import_copyreg(void)
|
|||
by storing a reference to the cached module in a static variable, but
|
||||
this broke when multiple embedded interpreters were in use (see issue
|
||||
#17408 and #19088). */
|
||||
copyreg_module = _PyImport_GetModuleWithError(copyreg_str);
|
||||
copyreg_module = PyDict_GetItemWithError(interp->modules, copyreg_str);
|
||||
if (copyreg_module != NULL) {
|
||||
Py_INCREF(copyreg_module);
|
||||
return copyreg_module;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue