summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-08-25 09:44:09 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2019-08-25 09:44:09 (GMT)
commitce6a070414ed1e1374d1e6212bfbff61b6d5d755 (patch)
tree55f9d0c54b98ad3c95e78a235668f6dbc314087b /Python/ceval.c
parent8371799e300475c8f9f967e900816218d3500e5d (diff)
downloadcpython-ce6a070414ed1e1374d1e6212bfbff61b6d5d755.zip
cpython-ce6a070414ed1e1374d1e6212bfbff61b6d5d755.tar.gz
cpython-ce6a070414ed1e1374d1e6212bfbff61b6d5d755.tar.bz2
bpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)
Fix assert statement misbehavior if AssertionError is shadowed.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index ee03350..7a3f42c 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2242,6 +2242,13 @@ main_loop:
}
}
+ case TARGET(LOAD_ASSERTION_ERROR): {
+ PyObject *value = PyExc_AssertionError;
+ Py_INCREF(value);
+ PUSH(value);
+ FAST_DISPATCH();
+ }
+
case TARGET(LOAD_BUILD_CLASS): {
_Py_IDENTIFIER(__build_class__);