mirror of
https://github.com/python/cpython.git
synced 2026-10-28 10:25:05 +08:00
gh-156909: Fix AST.__repr__ call getting the _fields attribute (GH-157490)
This commit is contained in:
1 parent
c68ce16cee
commit
1bfcc3cc87
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -1480,8 +1480,8 @@ ast_repr_max_depth(AST_object *self, int depth)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject *fields;
|
||||
if (PyObject_GetOptionalAttr((PyObject *)Py_TYPE(self), state->_fields, &fields) < 0) {
|
||||
PyObject *fields = PyObject_GetAttr((PyObject *)Py_TYPE(self), state->_fields);
|
||||
if (!fields) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -5792,8 +5792,8 @@ ast_repr_max_depth(AST_object *self, int depth)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject *fields;
|
||||
if (PyObject_GetOptionalAttr((PyObject *)Py_TYPE(self), state->_fields, &fields) < 0) {
|
||||
PyObject *fields = PyObject_GetAttr((PyObject *)Py_TYPE(self), state->_fields);
|
||||
if (!fields) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user