@@ -2411,20 +2411,14 @@ def loop():
24112411 self .assertEqual (opt .get_count (), 1000 )
24122412
24132413 def test_long_loop (self ):
2414- # Check that we aren't confused by EXTENDED_ARG
2414+ " Check that we aren't confused by EXTENDED_ARG"
24152415
24162416 # Generate a new function at each call
24172417 ns = {}
24182418 exec (textwrap .dedent ("""
24192419 def nop():
24202420 pass
24212421
2422- def short_loop():
2423- for _ in range(10):
2424- nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop();
2425- nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop();
2426- nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop();
2427-
24282422 def long_loop():
24292423 for _ in range(10):
24302424 nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop();
@@ -2435,21 +2429,14 @@ def long_loop():
24352429 nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop();
24362430 nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop();
24372431 """ ), ns , ns )
2438- short_loop = ns ['short_loop' ]
24392432 long_loop = ns ['long_loop' ]
24402433
24412434 opt = _testinternalcapi .get_counter_optimizer ()
24422435 with temporary_optimizer (opt ):
24432436 self .assertEqual (opt .get_count (), 0 )
2444- short_loop ()
2437+ long_loop ()
24452438 self .assertEqual (opt .get_count (), 10 )
24462439
2447- opt = _testinternalcapi .get_counter_optimizer ()
2448- with temporary_optimizer (opt ):
2449- self .assertEqual (opt .get_count (), 0 )
2450- long_loop () # Should not optimize!
2451- self .assertEqual (opt .get_count (), 0 )
2452-
24532440 def test_code_restore_for_ENTER_EXECUTOR (self ):
24542441 def testfunc (x ):
24552442 i = 0
0 commit comments