From 27829d3060b7c948747e78a0c7ada1334175be89 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 4 Jul 2020 01:09:06 +0200 Subject: [PATCH] bpo-41204: Fix compiler warning in ast_type_init() --- Parser/asdl_c.py | 9 +++++---- Python/Python-ast.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index b93906ba8d45d8..6fe44b99f793bb 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -688,13 +688,14 @@ def visitModule(self, mod): 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; } diff --git a/Python/Python-ast.c b/Python/Python-ast.c index b81b282a039659..396a6832702b35 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; } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy