Commit 67153528 authored by Christian Heimes's avatar Christian Heimes

Use PyString_InternFromString instead of PyString_FromString for static vars

parent 0a4f8956
......@@ -44,7 +44,7 @@ get_warnings_attr(const char *attr)
int result;
if (warnings_str == NULL) {
warnings_str = PyString_FromString("warnings");
warnings_str = PyString_InternFromString("warnings");
if (warnings_str == NULL)
return NULL;
}
......@@ -605,12 +605,12 @@ warnings_warn_explicit(PyObject *self, PyObject *args, PyObject *kwds)
PyObject *returned;
if (get_source_name == NULL) {
get_source_name = PyString_FromString("get_source");
get_source_name = PyString_InternFromString("get_source");
if (!get_source_name)
return NULL;
}
if (splitlines_name == NULL) {
splitlines_name = PyString_FromString("splitlines");
splitlines_name = PyString_InternFromString("splitlines");
if (!splitlines_name)
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment