Skip to content

Commit c757c3d

Browse files
author
gvanrossum
committed
Don't use (PyObject *)PyObject_Type(x). It is a leaky and verbose way
of saying x->ob_type. git-svn-id: http://svn.python.org/projects/python/trunk@32178 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 633c567 commit c757c3d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/parsermodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
681681
PyErr_Format(parser_error,
682682
"second item in terminal node must be a string,"
683683
" found %s",
684-
((PyTypeObject*)PyObject_Type(temp))->tp_name);
684+
temp->ob_type->tp_name);
685685
Py_DECREF(temp);
686686
return 0;
687687
}
@@ -694,7 +694,7 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
694694
PyErr_Format(parser_error,
695695
"third item in terminal node must be an"
696696
" integer, found %s",
697-
((PyTypeObject*)PyObject_Type(temp))->tp_name);
697+
temp->ob_type->tp_name);
698698
Py_DECREF(o);
699699
Py_DECREF(temp);
700700
return 0;

0 commit comments

Comments
 (0)