File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5039,6 +5039,20 @@ def testfunc(n):
50395039 uops = get_opnames (ex )
50405040 self .assertNotIn ("_LOAD_SUPER_ATTR_METHOD" , uops )
50415041 self .assertEqual (uops .count ("_GUARD_NOS_TYPE_VERSION" ), 2 )
5042+ exe = get_first_executor (testfunc )
5043+ self .assertIsNotNone (exe )
5044+ self .assertTrue (exe .is_valid ())
5045+ # this should change the type version of A, which should invalidate the executor
5046+ A .method1 = lambda self : 1
5047+ self .assertFalse (exe .is_valid ())
5048+ # re-running should create a new executor
5049+ res , ex = self ._run_with_optimizer (testfunc , 2 * TIER2_THRESHOLD )
5050+ self .assertEqual (res , 2 * 22 * TIER2_THRESHOLD )
5051+ self .assertIsNotNone (ex )
5052+ uops = get_opnames (ex )
5053+ self .assertNotIn ("_LOAD_SUPER_ATTR_METHOD" , uops )
5054+ self .assertEqual (uops .count ("_GUARD_NOS_TYPE_VERSION" ), 2 )
5055+
50425056
50435057def global_identity (x ):
50445058 return x
You can’t perform that action at this time.
0 commit comments