diff options
author | Victor Stinner <vstinner@python.org> | 2020-07-04 21:18:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-04 21:18:15 (GMT) |
commit | 1f76453173267887ed05bb3783e862cb22365ae8 (patch) | |
tree | 3bca4508f8900c2af761133e89da41b40c27926e /Parser | |
parent | b40e434386cd94a367d4a256e3364771140160e7 (diff) | |
download | cpython-1f76453173267887ed05bb3783e862cb22365ae8.zip cpython-1f76453173267887ed05bb3783e862cb22365ae8.tar.gz cpython-1f76453173267887ed05bb3783e862cb22365ae8.tar.bz2 |
bpo-41204: Fix compiler warning in ast_type_init() (GH-21307)
Diffstat (limited to 'Parser')
-rwxr-xr-x | Parser/asdl_c.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index b93906b..6fe44b9 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -688,13 +688,14 @@ ast_clear(AST_object *self) static int ast_type_init(PyObject *self, PyObject *args, PyObject *kw) { - Py_ssize_t i, numfields = 0; - int res = -1; - PyObject *key, *value, *fields; astmodulestate *state = get_global_ast_state(); if (state == NULL) { - goto cleanup; + return -1; } + + Py_ssize_t i, numfields = 0; + int res = -1; + PyObject *key, *value, *fields; if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { goto cleanup; } |