diff options
Diffstat (limited to 'Modules/parsermodule.c')
-rw-r--r-- | Modules/parsermodule.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index 7a23d8d..4167eb1 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -197,7 +197,7 @@ staticforward int parser_compare Py_PROTO((PyAST_Object *left, /* static */ PyTypeObject PyAST_Type = { - PyObject_HEAD_INIT(&PyType_Type) + PyObject_HEAD_INIT(NULL) 0, "ast", /* tp_name */ sizeof(PyAST_Object), /* tp_basicsize */ @@ -2593,8 +2593,12 @@ static PyMethodDef parser_functions[] = { void initparser() { - PyObject* module = Py_InitModule("parser", parser_functions); - PyObject* dict = PyModule_GetDict(module); + PyObject* module; + PyObject* dict; + + PyAST_Type.ob_type = &PyType_Type; + module = Py_InitModule("parser", parser_functions); + dict = PyModule_GetDict(module); parser_error = PyString_FromString("parser.ParserError"); |