@@ -1464,14 +1464,14 @@ class Bar:
14641464 pass
14651465
14661466 res , ex = self ._run_with_optimizer (thing , Foo ())
1467- opnames = list ( iter_opnames ( ex ))
1468- self . assertIsNotNone ( ex )
1469- self .assertEqual (res , TIER2_THRESHOLD * 6 + 1 )
1470- call = opnames .index ("_CALL_BUILTIN_FAST" )
1471- load_attr_top = opnames .index ("_POP_TOP_LOAD_CONST_INLINE_BORROW" , 0 , call )
1472- load_attr_bottom = opnames .index ("_POP_TOP_LOAD_CONST_INLINE_BORROW" , call )
1473- self .assertEqual (opnames [:load_attr_top ].count ("_GUARD_TYPE_VERSION" ), 1 )
1474- self .assertEqual (opnames [call :load_attr_bottom ].count ("_CHECK_VALIDITY" ), 2 )
1467+ if ex is not None :
1468+ opnames = list ( iter_opnames ( ex ) )
1469+ self .assertEqual (res , TIER2_THRESHOLD * 6 + 1 )
1470+ call = opnames .index ("_CALL_BUILTIN_FAST" )
1471+ load_attr_top = opnames .index ("_POP_TOP_LOAD_CONST_INLINE_BORROW" , 0 , call )
1472+ load_attr_bottom = opnames .index ("_POP_TOP_LOAD_CONST_INLINE_BORROW" , call )
1473+ self .assertEqual (opnames [:load_attr_top ].count ("_GUARD_TYPE_VERSION" ), 1 )
1474+ self .assertEqual (opnames [call :load_attr_bottom ].count ("_CHECK_VALIDITY" ), 2 )
14751475
14761476 def test_guard_type_version_removed_escaping (self ):
14771477
0 commit comments