Commit f923dab5 authored by Marius Wachtler's avatar Marius Wachtler

parser module: register static object

parent b85cb05f
# expected: reffail
# - leaked refs
import parser import parser
import unittest import unittest
import sys import sys
......
...@@ -3477,7 +3477,7 @@ initparser(void) ...@@ -3477,7 +3477,7 @@ initparser(void)
PyObject *func, *pickler; PyObject *func, *pickler;
func = PyObject_GetAttrString(copyreg, "pickle"); func = PyObject_GetAttrString(copyreg, "pickle");
pickle_constructor = PyObject_GetAttrString(module, "sequence2st"); pickle_constructor = PyGC_RegisterStaticConstant(PyObject_GetAttrString(module, "sequence2st"));
pickler = PyObject_GetAttrString(module, "_pickler"); pickler = PyObject_GetAttrString(module, "_pickler");
Py_XINCREF(pickle_constructor); Py_XINCREF(pickle_constructor);
if ((func != NULL) && (pickle_constructor != NULL) if ((func != NULL) && (pickle_constructor != 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