@@ -3059,52 +3059,6 @@ function_set_closure(PyObject *self, PyObject *args)
30593059 Py_RETURN_NONE ;
30603060}
30613061
3062- static PyObject *
3063- check_pyimport_addmodule (PyObject * self , PyObject * args )
3064- {
3065- const char * name ;
3066- if (!PyArg_ParseTuple (args , "s" , & name )) {
3067- return NULL ;
3068- }
3069-
3070- // test PyImport_AddModuleRef()
3071- PyObject * module = PyImport_AddModuleRef (name );
3072- if (module == NULL ) {
3073- return NULL ;
3074- }
3075- assert (PyModule_Check (module ));
3076- // module is a strong reference
3077-
3078- // test PyImport_AddModule()
3079- PyObject * module2 = PyImport_AddModule (name );
3080- if (module2 == NULL ) {
3081- goto error ;
3082- }
3083- assert (PyModule_Check (module2 ));
3084- assert (module2 == module );
3085- // module2 is a borrowed ref
3086-
3087- // test PyImport_AddModuleObject()
3088- PyObject * name_obj = PyUnicode_FromString (name );
3089- if (name_obj == NULL ) {
3090- goto error ;
3091- }
3092- PyObject * module3 = PyImport_AddModuleObject (name_obj );
3093- Py_DECREF (name_obj );
3094- if (module3 == NULL ) {
3095- goto error ;
3096- }
3097- assert (PyModule_Check (module3 ));
3098- assert (module3 == module );
3099- // module3 is a borrowed ref
3100-
3101- return module ;
3102-
3103- error :
3104- Py_DECREF (module );
3105- return NULL ;
3106- }
3107-
31083062
31093063static PyObject *
31103064test_weakref_capi (PyObject * Py_UNUSED (module ), PyObject * Py_UNUSED (args ))
@@ -3570,7 +3524,6 @@ static PyMethodDef TestMethods[] = {
35703524 {"function_set_kw_defaults" , function_set_kw_defaults , METH_VARARGS , NULL },
35713525 {"function_get_closure" , function_get_closure , METH_O , NULL },
35723526 {"function_set_closure" , function_set_closure , METH_VARARGS , NULL },
3573- {"check_pyimport_addmodule" , check_pyimport_addmodule , METH_VARARGS },
35743527 {"test_weakref_capi" , test_weakref_capi , METH_NOARGS },
35753528 {"function_set_warning" , function_set_warning , METH_NOARGS },
35763529 {"test_critical_sections" , test_critical_sections , METH_NOARGS },
0 commit comments