File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2166,27 +2166,33 @@ class D:
21662166 A = 1
21672167 def m (self ):
21682168 return 1
2169+ class E (Exception ):
2170+ def m (self ):
2171+ return 1
21692172 def f (n ):
21702173 x = 0
21712174 c = C ()
21722175 d = D ()
2176+ e = E ()
21732177 for _ in range (n ):
21742178 x += C .A # _LOAD_ATTR_CLASS
21752179 x += c .A # _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES
21762180 x += d .A # _LOAD_ATTR_NONDESCRIPTOR_NO_DICT
21772181 x += c .m () # _LOAD_ATTR_METHOD_WITH_VALUES
21782182 x += d .m () # _LOAD_ATTR_METHOD_NO_DICT
2183+ x += e .m () # _LOAD_ATTR_METHOD_LAZY_DICT
21792184 return x
21802185
21812186 res , ex = self ._run_with_optimizer (f , TIER2_THRESHOLD )
2182- self .assertEqual (res , 5 * TIER2_THRESHOLD )
2187+ self .assertEqual (res , 6 * TIER2_THRESHOLD )
21832188 self .assertIsNotNone (ex )
21842189 uops = get_opnames (ex )
21852190 self .assertNotIn ("_LOAD_ATTR_CLASS" , uops )
21862191 self .assertNotIn ("_LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES" , uops )
21872192 self .assertNotIn ("_LOAD_ATTR_NONDESCRIPTOR_NO_DICT" , uops )
21882193 self .assertNotIn ("_LOAD_ATTR_METHOD_WITH_VALUES" , uops )
21892194 self .assertNotIn ("_LOAD_ATTR_METHOD_NO_DICT" , uops )
2195+ self .assertNotIn ("_LOAD_ATTR_METHOD_LAZY_DICT" , uops )
21902196
21912197
21922198def global_identity (x ):
You can’t perform that action at this time.
0 commit comments