diff options
author | Victor Stinner <vstinner@python.org> | 2020-07-04 23:18:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-04 23:18:15 +0200 |
commit | 1f76453173267887ed05bb3783e862cb22365ae8 (patch) | |
tree | 3bca4508f8900c2af761133e89da41b40c27926e /Parser | |
parent | bpo-33864: Clarify the docs for typing.ByteString (GH-21311) (diff) | |
download | cpython-1f76453173267887ed05bb3783e862cb22365ae8.tar.gz cpython-1f76453173267887ed05bb3783e862cb22365ae8.tar.bz2 cpython-1f76453173267887ed05bb3783e862cb22365ae8.zip |
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 b93906ba8d4..6fe44b99f79 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; } |