@@ -297,13 +297,10 @@ def test_elim_jump_to_uncond_jump(self):
297297 # JUMP_FORWARD to JUMP_FORWARD --> JUMP_FORWARD to non-jump
298298 def f ():
299299 if a :
300- if b :
301- # Intentionally use two-line expression to test issue37213.
302- if (c
303- or d ):
304- foo ()
305- else :
306- bar ()
300+ # Intentionally use two-line expression to test issue37213.
301+ if (c
302+ or d ):
303+ foo ()
307304 else :
308305 baz ()
309306 self .check_jump_targets (f )
@@ -313,13 +310,10 @@ def test_elim_jump_to_uncond_jump2(self):
313310 # JUMP_FORWARD to JUMP_ABSOLUTE --> JUMP_FORWARD to non-jump
314311 def f ():
315312 while a :
316- if b :
317- # Intentionally use two-line expression to test issue37213.
318- if (c
319- or d ):
320- a = foo ()
321- else :
322- a = bar ()
313+ # Intentionally use two-line expression to test issue37213.
314+ if (c
315+ or d ):
316+ a = foo ()
323317 self .check_jump_targets (f )
324318
325319 def test_elim_jump_to_uncond_jump3 (self ):
@@ -422,33 +416,6 @@ def forloop():
422416 pass
423417 self .assertEqual (count_instr_recursively (forloop , 'BUILD_LIST' ), 0 )
424418
425- def test_multiline_statements_are_not_treated_differently (self ):
426- code1 = compile ("[x for x in a if x]" , "" , 'single' ).co_consts [0 ]
427- code2 = compile ("[x \n for x in a if x]" , "" , 'single' ).co_consts [0 ]
428- self .assertEqual (type (code1 ), types .CodeType )
429- self .assertEqual (type (code2 ), types .CodeType )
430- self .assertNotEqual (list (code1 .co_lnotab ), list (code2 .co_lnotab ))
431- self .assertEqual (list (code1 .co_code ), list (code2 .co_code ))
432-
433- code1 = compile (textwrap .dedent ("""\
434- if x:
435- if (y and z):
436- foo()
437- else:
438- bar()
439- """ ), "" , 'exec' )
440- code2 = compile (textwrap .dedent ("""\
441- if x:
442- if (y and
443- z):
444- foo()
445- else:
446- bar()
447- """ ), "" , 'exec' )
448-
449- self .assertNotEqual (list (code1 .co_lnotab ), list (code2 .co_lnotab ))
450- self .assertEqual (list (code1 .co_code ), list (code2 .co_code ))
451-
452419
453420class TestBuglets (unittest .TestCase ):
454421
0 commit comments