bpo-41204: Fix compiler warning in ast_type_init() (GH-21307)
This commit is contained in:
parent
b40e434386
commit
1f76453173
|
@ -688,13 +688,14 @@ ast_clear(AST_object *self)
|
||||||
static int
|
static int
|
||||||
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
|
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
|
||||||
{
|
{
|
||||||
|
astmodulestate *state = get_global_ast_state();
|
||||||
|
if (state == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
Py_ssize_t i, numfields = 0;
|
Py_ssize_t i, numfields = 0;
|
||||||
int res = -1;
|
int res = -1;
|
||||||
PyObject *key, *value, *fields;
|
PyObject *key, *value, *fields;
|
||||||
astmodulestate *state = get_global_ast_state();
|
|
||||||
if (state == NULL) {
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) {
|
if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1140,13 +1140,14 @@ ast_clear(AST_object *self)
|
||||||
static int
|
static int
|
||||||
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
|
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
|
||||||
{
|
{
|
||||||
|
astmodulestate *state = get_global_ast_state();
|
||||||
|
if (state == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
Py_ssize_t i, numfields = 0;
|
Py_ssize_t i, numfields = 0;
|
||||||
int res = -1;
|
int res = -1;
|
||||||
PyObject *key, *value, *fields;
|
PyObject *key, *value, *fields;
|
||||||
astmodulestate *state = get_global_ast_state();
|
|
||||||
if (state == NULL) {
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) {
|
if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue