mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +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
|
@ -1965,7 +1965,7 @@ file_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
assert(type != NULL && type->tp_alloc != NULL);
|
||||
|
||||
if (not_yet_string == NULL) {
|
||||
not_yet_string = PyString_FromString("<uninitialized file>");
|
||||
not_yet_string = PyString_InternFromString("<uninitialized file>");
|
||||
if (not_yet_string == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue