aboutsummaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-07-04 23:18:15 +0200
committerGitHub <noreply@github.com>2020-07-04 23:18:15 +0200
commit1f76453173267887ed05bb3783e862cb22365ae8 (patch)
tree3bca4508f8900c2af761133e89da41b40c27926e /Parser
parentbpo-33864: Clarify the docs for typing.ByteString (GH-21311) (diff)
downloadcpython-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-xParser/asdl_c.py9
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;
}