From: Guido van Rossum Date: Wed, 9 Apr 2003 17:53:22 +0000 (+0000) Subject: Don't use (PyObject *)PyObject_Type(x). It is a leaky and verbose way X-Git-Tag: v2.3c1~1246 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc29646a2ee942e39a431d7240ee30f91f2436d3;p=thirdparty%2FPython%2Fcpython.git Don't use (PyObject *)PyObject_Type(x). It is a leaky and verbose way of saying x->ob_type. --- diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index eb9599c95262..91f15e3769bc 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -681,7 +681,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num) PyErr_Format(parser_error, "second item in terminal node must be a string," " found %s", - ((PyTypeObject*)PyObject_Type(temp))->tp_name); + temp->ob_type->tp_name); Py_DECREF(temp); return 0; } @@ -694,7 +694,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num) PyErr_Format(parser_error, "third item in terminal node must be an" " integer, found %s", - ((PyTypeObject*)PyObject_Type(temp))->tp_name); + temp->ob_type->tp_name); Py_DECREF(o); Py_DECREF(temp); return 0;