Skip to content

Commit 1f76453

Browse files
authored
bpo-41204: Fix compiler warning in ast_type_init() (GH-21307)
1 parent b40e434 commit 1f76453

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Parser/asdl_c.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,13 +688,14 @@ def visitModule(self, mod):
688688
static int
689689
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
690690
{
691-
Py_ssize_t i, numfields = 0;
692-
int res = -1;
693-
PyObject *key, *value, *fields;
694691
astmodulestate *state = get_global_ast_state();
695692
if (state == NULL) {
696-
goto cleanup;
693+
return -1;
697694
}
695+
696+
Py_ssize_t i, numfields = 0;
697+
int res = -1;
698+
PyObject *key, *value, *fields;
698699
if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) {
699700
goto cleanup;
700701
}

Python/Python-ast.c

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)