diff options
author | Mark Shannon <mark@hotpy.org> | 2021-05-07 15:19:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-07 15:19:19 +0100 |
commit | adcd2205565f91c6719f4141ab4e1da6d7086126 (patch) | |
tree | 0953b285944eccde57b05b8f3c7e30fb501a3d64 /Lib/test/test_exceptions.py | |
parent | b32c8e97951db46484ba3b646b988bcdc4062199 (diff) | |
download | cpython-git-adcd2205565f91c6719f4141ab4e1da6d7086126.tar.gz |
bpo-40222: "Zero cost" exception handling (GH-25729)
"Zero cost" exception handling.
* Uses a lookup table to determine how to handle exceptions.
* Removes SETUP_FINALLY and POP_TOP block instructions, eliminating (most of) the runtime overhead of try statements.
* Reduces the size of the frame object by about 60%.
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r-- | Lib/test/test_exceptions.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 3c427fed56..1fe479fbe8 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -218,7 +218,7 @@ class ExceptionTests(unittest.TestCase): check('class foo:return 1', 1, 11) check('def f():\n continue', 2, 3) check('def f():\n break', 2, 3) - check('try:\n pass\nexcept:\n pass\nexcept ValueError:\n pass', 2, 3) + check('try:\n pass\nexcept:\n pass\nexcept ValueError:\n pass', 3, 1) # Errors thrown by tokenizer.c check('(0x+1)', 1, 3) |