summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-07-04 21:18:15 (GMT)
committerGitHub <noreply@github.com>2020-07-04 21:18:15 (GMT)
commit1f76453173267887ed05bb3783e862cb22365ae8 (patch)
tree3bca4508f8900c2af761133e89da41b40c27926e /Parser
parentb40e434386cd94a367d4a256e3364771140160e7 (diff)
downloadcpython-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-xParser/asdl_c.py9
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;
}