From 1f76453173267887ed05bb3783e862cb22365ae8 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 4 Jul 2020 23:18:15 +0200 Subject: bpo-41204: Fix compiler warning in ast_type_init() (GH-21307) --- Python/Python-ast.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Python/Python-ast.c') diff --git a/Python/Python-ast.c b/Python/Python-ast.c index b81b282a03..396a683270 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -1140,13 +1140,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; } -- cgit v1.2.1