summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-06 21:40:41 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-06 21:40:41 (GMT)
commitbb52020d44b6f3f1ebd16ec6ce38f1f8a6330728 (patch)
tree8d0676b3cd0e30e7dd56fe6313c651450b5f6caf /Modules
parentcab75e3e1e4df9ac8ffc1753e3c06cf1b3688e35 (diff)
downloadcpython-bb52020d44b6f3f1ebd16ec6ce38f1f8a6330728.zip
cpython-bb52020d44b6f3f1ebd16ec6ce38f1f8a6330728.tar.gz
cpython-bb52020d44b6f3f1ebd16ec6ce38f1f8a6330728.tar.bz2
Issue #19512: pickle now uses an identifier to only create the Unicode string
"modules" once
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_pickle.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index a14a258..75b0441 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -136,6 +136,8 @@ static PyObject *empty_tuple = NULL;
/* For looking up name pairs in copyreg._extension_registry. */
static PyObject *two_tuple = NULL;
+_Py_IDENTIFIER(modules);
+
static int
stack_underflow(void)
{
@@ -1363,7 +1365,7 @@ whichmodule(PyObject *global, PyObject *global_name)
return NULL;
search:
- modules_dict = PySys_GetObject("modules");
+ modules_dict = _PySys_GetObjectId(&PyId_modules);
if (modules_dict == NULL) {
PyErr_SetString(PyExc_RuntimeError, "unable to get sys.modules");
return NULL;
@@ -5548,7 +5550,7 @@ Unpickler_find_class(UnpicklerObject *self, PyObject *args)
}
}
- modules_dict = PySys_GetObject("modules");
+ modules_dict = _PySys_GetObjectId(&PyId_modules);
if (modules_dict == NULL) {
PyErr_SetString(PyExc_RuntimeError, "unable to get sys.modules");
return NULL;