@@ -1534,8 +1534,8 @@ dummy_func(
15341534 }
15351535
15361536 inst (LOAD_BUILD_CLASS , ( -- bc )) {
1537- PyObject * bc_o ;
1538- int err = PyMapping_GetOptionalItem (BUILTINS (), & _Py_ID (__build_class__ ), & bc_o );
1537+ PyObject * restrict bc_o ;
1538+ int err = _PyEval_Mapping_GetOptionalItem (BUILTINS (), & _Py_ID (__build_class__ ), & bc_o );
15391539 ERROR_IF (err < 0 );
15401540 if (bc_o == NULL ) {
15411541 _PyErr_SetString (tstate , PyExc_NameError ,
@@ -1738,8 +1738,8 @@ dummy_func(
17381738
17391739 inst (LOAD_FROM_DICT_OR_GLOBALS , (mod_or_class_dict -- v )) {
17401740 PyObject * name = GETITEM (FRAME_CO_NAMES , oparg );
1741- PyObject * v_o ;
1742- int err = PyMapping_GetOptionalItem (PyStackRef_AsPyObjectBorrow (mod_or_class_dict ), name , & v_o );
1741+ PyObject * restrict v_o ;
1742+ int err = _PyEval_Mapping_GetOptionalItem (PyStackRef_AsPyObjectBorrow (mod_or_class_dict ), name , & v_o );
17431743 PyStackRef_CLOSE (mod_or_class_dict );
17441744 ERROR_IF (err < 0 );
17451745 if (v_o == NULL ) {
@@ -1762,11 +1762,11 @@ dummy_func(
17621762 else {
17631763 /* Slow-path if globals or builtins is not a dict */
17641764 /* namespace 1: globals */
1765- int err = PyMapping_GetOptionalItem (GLOBALS (), name , & v_o );
1765+ int err = _PyEval_Mapping_GetOptionalItem (GLOBALS (), name , & v_o );
17661766 ERROR_IF (err < 0 );
17671767 if (v_o == NULL ) {
17681768 /* namespace 2: builtins */
1769- int err = PyMapping_GetOptionalItem (BUILTINS (), name , & v_o );
1769+ int err = _PyEval_Mapping_GetOptionalItem (BUILTINS (), name , & v_o );
17701770 ERROR_IF (err < 0 );
17711771 if (v_o == NULL ) {
17721772 _PyEval_FormatExcCheckArg (
@@ -1925,14 +1925,14 @@ dummy_func(
19251925 }
19261926
19271927 inst (LOAD_FROM_DICT_OR_DEREF , (class_dict_st -- value )) {
1928- PyObject * value_o ;
1928+ PyObject * restrict value_o ;
19291929 PyObject * name ;
19301930 PyObject * class_dict = PyStackRef_AsPyObjectBorrow (class_dict_st );
19311931
19321932 assert (class_dict );
19331933 assert (oparg >= 0 && oparg < _PyFrame_GetCode (frame )-> co_nlocalsplus );
19341934 name = PyTuple_GET_ITEM (_PyFrame_GetCode (frame )-> co_localsplusnames , oparg );
1935- int err = PyMapping_GetOptionalItem (class_dict , name , & value_o );
1935+ int err = _PyEval_Mapping_GetOptionalItem (class_dict , name , & value_o );
19361936 if (err < 0 ) {
19371937 ERROR_NO_POP ();
19381938 }
@@ -2115,14 +2115,14 @@ dummy_func(
21152115 }
21162116
21172117 inst (SETUP_ANNOTATIONS , (-- )) {
2118- PyObject * ann_dict ;
2118+ PyObject * restrict ann_dict ;
21192119 if (LOCALS () == NULL ) {
21202120 _PyErr_Format (tstate , PyExc_SystemError ,
21212121 "no locals found when setting up annotations" );
21222122 ERROR_IF (true);
21232123 }
21242124 /* check if __annotations__ in locals()... */
2125- int err = PyMapping_GetOptionalItem (LOCALS (), & _Py_ID (__annotations__ ), & ann_dict );
2125+ int err = _PyEval_Mapping_GetOptionalItem (LOCALS (), & _Py_ID (__annotations__ ), & ann_dict );
21262126 ERROR_IF (err < 0 );
21272127 if (ann_dict == NULL ) {
21282128 ann_dict = PyDict_New ();
@@ -2289,18 +2289,13 @@ dummy_func(
22892289 PyObject * name = GETITEM (FRAME_CO_NAMES , oparg >> 2 );
22902290 PyTypeObject * cls = (PyTypeObject * )class ;
22912291 int method_found = 0 ;
2292- PyObject * attr_o = _PySuper_Lookup (cls , self , name ,
2293- Py_TYPE (self )-> tp_getattro == PyObject_GenericGetAttr ? & method_found : NULL );
2292+ PyObject * attr_o = _PySuper_Lookup (cls , self , name , NULL );
22942293 if (attr_o == NULL ) {
22952294 ERROR_NO_POP ();
22962295 }
2297- if (method_found ) {
2298- self_or_null = self_st ; // transfer ownership
2299- DEAD (self_st );
2300- } else {
2301- PyStackRef_CLOSE (self_st );
2302- self_or_null = PyStackRef_NULL ;
2303- }
2296+ PyStackRef_CLOSE (self_st );
2297+ self_or_null = PyStackRef_NULL ;
2298+
23042299 DECREF_INPUTS ();
23052300
23062301 attr = PyStackRef_FromPyObjectSteal (attr_o );
0 commit comments