Don't use (PyObject *)PyObject_Type(x). It is a leaky and verbose way
of saying x->ob_type.
This commit is contained in:
parent
a6b1c75b7a
commit
fc29646a2e
@ -681,7 +681,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
|
|||||||
PyErr_Format(parser_error,
|
PyErr_Format(parser_error,
|
||||||
"second item in terminal node must be a string,"
|
"second item in terminal node must be a string,"
|
||||||
" found %s",
|
" found %s",
|
||||||
((PyTypeObject*)PyObject_Type(temp))->tp_name);
|
temp->ob_type->tp_name);
|
||||||
Py_DECREF(temp);
|
Py_DECREF(temp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -694,7 +694,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
|
|||||||
PyErr_Format(parser_error,
|
PyErr_Format(parser_error,
|
||||||
"third item in terminal node must be an"
|
"third item in terminal node must be an"
|
||||||
" integer, found %s",
|
" integer, found %s",
|
||||||
((PyTypeObject*)PyObject_Type(temp))->tp_name);
|
temp->ob_type->tp_name);
|
||||||
Py_DECREF(o);
|
Py_DECREF(o);
|
||||||
Py_DECREF(temp);
|
Py_DECREF(temp);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user