summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-09-28 19:33:28 (GMT)
committerGitHub <noreply@github.com>2023-09-28 19:33:28 (GMT)
commitf580edcc6a4c528020afe46c753db713474acad6 (patch)
treeccc20e518bdb608d352ee87cfbd0c610c1973011 /Lib/test/test_compile.py
parentb14f0ab51cb4851b25935279617e388456dcf716 (diff)
downloadcpython-f580edcc6a4c528020afe46c753db713474acad6.zip
cpython-f580edcc6a4c528020afe46c753db713474acad6.tar.gz
cpython-f580edcc6a4c528020afe46c753db713474acad6.tar.bz2
gh-109889: fix compiler's redundant NOP detection to look past NOPs with no lineno when looking for the next instruction's lineno (#109987)
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 53e3e8f..c4452e3 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -1278,6 +1278,11 @@ class TestSpecifics(unittest.TestCase):
while x:
0 if 1 else 0
+ def test_remove_redundant_nop_edge_case(self):
+ # See gh-109889
+ def f():
+ a if (1 if b else c) else d
+
@requires_debug_ranges()
class TestSourcePositions(unittest.TestCase):
# Ensure that compiled code snippets have correct line and column numbers