From 1e7b858575d0ad782939f86aae4a2fa1c29e9f14 Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Thu, 29 Apr 2021 15:58:44 +1000 Subject: bpo-43892: Make match patterns explicit in the AST (GH-25585) Co-authored-by: Brandt Bucher --- Python/bltinmodule.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Python/bltinmodule.c') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 3b0e59a6d1..66a74cbdef 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -831,11 +831,7 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, if (arena == NULL) goto error; mod = PyAST_obj2mod(source, arena, compile_mode); - if (mod == NULL) { - _PyArena_Free(arena); - goto error; - } - if (!_PyAST_Validate(mod)) { + if (mod == NULL || !_PyAST_Validate(mod)) { _PyArena_Free(arena); goto error; } -- cgit v1.2.1