summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-10-12 00:19:38 -0700
committerGitHub <noreply@github.com>2018-10-12 00:19:38 -0700
commitf39defe11a4ed688489c7827a8b69752af29391a (patch)
treea55be43bbc64b7eb35a2a4cd3e87229e1549e34f /Python
parent69e6ad6cdfa28a7b8e7b8780b07dfcdbfb0e7030 (diff)
downloadcpython-git-f39defe11a4ed688489c7827a8b69752af29391a.tar.gz
Fix an incorrect check in compiler_try_except(). (GH-9810)
(cherry picked from commit 53ebf4b0709f431b7262aa5daccef7eafde7383e) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index c1df7e8d98..fac1c5bfdc 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2492,8 +2492,9 @@ compiler_try_except(struct compiler *c, stmt_ty s)
cleanup_end = compiler_new_block(c);
cleanup_body = compiler_new_block(c);
- if (!(cleanup_end || cleanup_body))
+ if (cleanup_end == NULL || cleanup_body == NULL) {
return 0;
+ }
compiler_nameop(c, handler->v.ExceptHandler.name, Store);
ADDOP(c, POP_TOP);