summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-12-19 11:04:44 (GMT)
committerGitHub <noreply@github.com>2023-12-19 11:04:44 (GMT)
commite51b4009454939e3ee5f1bfaed45ce65689a71b8 (patch)
tree0933d9a4624dbb4f74a00ef5e1e4dfdcf7ab5327 /Lib/test
parent76d757b38b414964546393bdccff31c1f8be3843 (diff)
downloadcpython-e51b4009454939e3ee5f1bfaed45ce65689a71b8.zip
cpython-e51b4009454939e3ee5f1bfaed45ce65689a71b8.tar.gz
cpython-e51b4009454939e3ee5f1bfaed45ce65689a71b8.tar.bz2
gh-113054: Compiler no longer replaces a redundant jump with no line number by a NOP (#113139)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_compile.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index f681d12..906e16c 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -444,6 +444,10 @@ class TestSpecifics(unittest.TestCase):
self.assertIn("_A__mangled_mod", A.f.__code__.co_varnames)
self.assertIn("__package__", A.f.__code__.co_varnames)
+ def test_condition_expression_with_dead_blocks_compiles(self):
+ # See gh-113054
+ compile('if (5 if 5 else T): 0', '<eval>', 'exec')
+
def test_compile_invalid_namedexpr(self):
# gh-109351
m = ast.Module(