@@ -4586,18 +4586,18 @@ new_hamt(PyObject *self, PyObject *args)
45864586static PyObject *
45874587bad_get (PyObject * module , PyObject * const * args , Py_ssize_t nargs )
45884588{
4589- if ( nargs != 3 ) {
4590- PyErr_SetString ( PyExc_TypeError , "bad_get requires exactly 3 arguments" );
4589+ PyObject * self , * obj , * cls ;
4590+ if (! _PyArg_UnpackStack ( args , nargs , "bad_get" , 3 , 3 , & self , & obj , & cls )) {
45914591 return NULL ;
45924592 }
45934593
4594- PyObject * res = PyObject_CallObject (args [ 2 ] , NULL );
4594+ PyObject * res = PyObject_CallObject (cls , NULL );
45954595 if (res == NULL ) {
45964596 return NULL ;
45974597 }
45984598 Py_DECREF (res );
45994599
4600- return PyObject_Repr (args [ 0 ] );
4600+ return PyObject_Repr (self );
46014601}
46024602
46034603
@@ -4960,7 +4960,7 @@ static PyMethodDef TestMethods[] = {
49604960 {"get_mapping_items" , get_mapping_items , METH_O },
49614961 {"test_pythread_tss_key_state" , test_pythread_tss_key_state , METH_VARARGS },
49624962 {"hamt" , new_hamt , METH_NOARGS },
4963- {"bad_get" , bad_get , METH_FASTCALL },
4963+ {"bad_get" , ( PyCFunction ) bad_get , METH_FASTCALL },
49644964 {"EncodeLocaleEx" , encode_locale_ex , METH_VARARGS },
49654965 {"DecodeLocaleEx" , decode_locale_ex , METH_VARARGS },
49664966 {"get_global_config" , get_global_config , METH_NOARGS },
0 commit comments