mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
static PyObject* variables should use PyString_InternFromString() instead of PyObject_FromString() to store a python string in a function level static var.
This commit is contained in:
parent
908caac52e
commit
d7e1b2bd17
6 changed files with 17 additions and 16 deletions
|
|
@ -2142,7 +2142,7 @@ abstract_get_bases(PyObject *cls)
|
|||
PyObject *bases;
|
||||
|
||||
if (__bases__ == NULL) {
|
||||
__bases__ = PyString_FromString("__bases__");
|
||||
__bases__ = PyString_InternFromString("__bases__");
|
||||
if (__bases__ == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -2220,7 +2220,7 @@ recursive_isinstance(PyObject *inst, PyObject *cls, int recursion_depth)
|
|||
int retval = 0;
|
||||
|
||||
if (__class__ == NULL) {
|
||||
__class__ = PyString_FromString("__class__");
|
||||
__class__ = PyString_InternFromString("__class__");
|
||||
if (__class__ == NULL)
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue