mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
gh-113603: Compiler no longer tries to maintain the no-empty-block invariant (#113636)
This commit is contained in:
parent
0c3455a969
commit
7d01fb4808
3 changed files with 52 additions and 78 deletions
|
@ -448,6 +448,19 @@ class TestSpecifics(unittest.TestCase):
|
|||
# See gh-113054
|
||||
compile('if (5 if 5 else T): 0', '<eval>', 'exec')
|
||||
|
||||
def test_condition_expression_with_redundant_comparisons_compiles(self):
|
||||
# See gh-113054
|
||||
compile('if 9<9<9and 9or 9:9', '<eval>', 'exec')
|
||||
|
||||
def test_dead_code_with_except_handler_compiles(self):
|
||||
compile(textwrap.dedent("""
|
||||
if None:
|
||||
with CM:
|
||||
x = 1
|
||||
else:
|
||||
x = 2
|
||||
"""), '<eval>', 'exec')
|
||||
|
||||
def test_compile_invalid_namedexpr(self):
|
||||
# gh-109351
|
||||
m = ast.Module(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue