summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2021-04-29 05:58:44 (GMT)
committerGitHub <noreply@github.com>2021-04-29 05:58:44 (GMT)
commit1e7b858575d0ad782939f86aae4a2fa1c29e9f14 (patch)
tree9445a7a82905c5bb253564853f33dacfceac6e93 /Python/bltinmodule.c
parente52ab42cedd2a5ef4c3c1a47d0cf96a8f06d051f (diff)
downloadcpython-1e7b858575d0ad782939f86aae4a2fa1c29e9f14.zip
cpython-1e7b858575d0ad782939f86aae4a2fa1c29e9f14.tar.gz
cpython-1e7b858575d0ad782939f86aae4a2fa1c29e9f14.tar.bz2
bpo-43892: Make match patterns explicit in the AST (GH-25585)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 3b0e59a..66a74cb 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;
}