]> granicus.if.org Git - python/commitdiff
Don't use (PyObject *)PyObject_Type(x). It is a leaky and verbose way
authorGuido van Rossum <guido@python.org>
Wed, 9 Apr 2003 17:53:22 +0000 (17:53 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 9 Apr 2003 17:53:22 +0000 (17:53 +0000)
of saying x->ob_type.

Modules/parsermodule.c

index eb9599c95262b3aba915ff70b241ac90ca9646c3..91f15e3769bc0248f4a9ffb99a326caa256de4ab 100644 (file)
@@ -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;