summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Python/Python-ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tools/python3/Python/Python-ast.c')
-rw-r--r--contrib/tools/python3/Python/Python-ast.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/tools/python3/Python/Python-ast.c b/contrib/tools/python3/Python/Python-ast.c
index ecaff2041f9..3d5aeff8379 100644
--- a/contrib/tools/python3/Python/Python-ast.c
+++ b/contrib/tools/python3/Python/Python-ast.c
@@ -863,14 +863,15 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
Py_ssize_t i, numfields = 0;
int res = -1;
PyObject *key, *value, *fields;
- if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) {
+
+ fields = PyObject_GetAttr((PyObject*)Py_TYPE(self), state->_fields);
+ if (fields == NULL) {
goto cleanup;
}
- if (fields) {
- numfields = PySequence_Size(fields);
- if (numfields == -1) {
- goto cleanup;
- }
+
+ numfields = PySequence_Size(fields);
+ if (numfields == -1) {
+ goto cleanup;
}
res = 0; /* if no error occurs, this stays 0 to the end */