Commit 2b13b66e authored by Kevin Modzelewski's avatar Kevin Modzelewski

Ref fixes

parent e383ced8
...@@ -44,7 +44,7 @@ get_warnings_attr(const char *attr) ...@@ -44,7 +44,7 @@ get_warnings_attr(const char *attr)
int result; int result;
if (warnings_str == NULL) { if (warnings_str == NULL) {
warnings_str = PyString_InternFromString("warnings"); warnings_str = PyGC_RegisterStaticConstant(PyString_InternFromString("warnings"));
if (warnings_str == NULL) if (warnings_str == NULL)
return NULL; return NULL;
} }
...@@ -658,12 +658,12 @@ warnings_warn_explicit(PyObject *self, PyObject *args, PyObject *kwds) ...@@ -658,12 +658,12 @@ warnings_warn_explicit(PyObject *self, PyObject *args, PyObject *kwds)
PyObject *returned; PyObject *returned;
if (get_source_name == NULL) { if (get_source_name == NULL) {
get_source_name = PyString_InternFromString("get_source"); get_source_name = PyGC_RegisterStaticConstant(PyString_InternFromString("get_source"));
if (!get_source_name) if (!get_source_name)
return NULL; return NULL;
} }
if (splitlines_name == NULL) { if (splitlines_name == NULL) {
splitlines_name = PyString_InternFromString("splitlines"); splitlines_name = PyGC_RegisterStaticConstant(PyString_InternFromString("splitlines"));
if (!splitlines_name) if (!splitlines_name)
return NULL; return NULL;
} }
......
This diff is collapsed.
...@@ -4334,6 +4334,7 @@ void setupRuntime() { ...@@ -4334,6 +4334,7 @@ void setupRuntime() {
_PyExc_Init(); _PyExc_Init();
_PyImport_Init(); _PyImport_Init();
_PyImportHooks_Init(); _PyImportHooks_Init();
_PyWarnings_Init();
PyType_Ready(&PyByteArrayIter_Type); PyType_Ready(&PyByteArrayIter_Type);
PyType_Ready(&PyCapsule_Type); PyType_Ready(&PyCapsule_Type);
......
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