@@ -3600,53 +3600,6 @@ imp_load_source(PyObject *self, PyObject *args)
36003600 return m ;
36013601}
36023602
3603- static PyObject *
3604- imp_load_module (PyObject * self , PyObject * args )
3605- {
3606- PyObject * name , * fob , * pathname , * pathname_obj , * ret ;
3607- char * suffix ; /* Unused */
3608- char * mode ;
3609- int type ;
3610- FILE * fp ;
3611-
3612- if (!PyArg_ParseTuple (args , "UOO(ssi):load_module" ,
3613- & name , & fob , & pathname_obj , & suffix , & mode , & type ))
3614- return NULL ;
3615- if (pathname_obj != Py_None ) {
3616- if (!PyUnicode_FSDecoder (pathname_obj , & pathname ))
3617- return NULL ;
3618- }
3619- else
3620- pathname = NULL ;
3621-
3622- if (* mode ) {
3623- /* Mode must start with 'r' or 'U' and must not contain '+'.
3624- Implicit in this test is the assumption that the mode
3625- may contain other modifiers like 'b' or 't'. */
3626-
3627- if (!(* mode == 'r' || * mode == 'U' ) || strchr (mode , '+' )) {
3628- PyErr_Format (PyExc_ValueError ,
3629- "invalid file open mode %.200s" , mode );
3630- Py_XDECREF (pathname );
3631- return NULL ;
3632- }
3633- }
3634- if (fob == Py_None )
3635- fp = NULL ;
3636- else {
3637- fp = get_file (NULL , fob , mode );
3638- if (fp == NULL ) {
3639- Py_XDECREF (pathname );
3640- return NULL ;
3641- }
3642- }
3643- ret = load_module (name , fp , pathname , type , NULL );
3644- Py_XDECREF (pathname );
3645- if (fp )
3646- fclose (fp );
3647- return ret ;
3648- }
3649-
36503603static PyObject *
36513604imp_load_package (PyObject * self , PyObject * args )
36523605{
@@ -3757,11 +3710,6 @@ built-in, frozen or special module and continue search in sys.path.\n\
37573710The module name cannot contain '.'; to search for a submodule of a\n\
37583711package, pass the submodule name and the package's __path__." );
37593712
3760- PyDoc_STRVAR (doc_load_module ,
3761- "load_module(name, file, filename, (suffix, mode, type)) -> module\n\
3762- Load a module, given information returned by find_module().\n\
3763- The module name must include the full package name, if any." );
3764-
37653713PyDoc_STRVAR (doc_get_magic ,
37663714"get_magic() -> string\n\
37673715Return the magic number for .pyc or .pyo files." );
@@ -3797,7 +3745,6 @@ static PyMethodDef imp_methods[] = {
37973745 {"get_magic" , imp_get_magic , METH_NOARGS , doc_get_magic },
37983746 {"get_tag" , imp_get_tag , METH_NOARGS , doc_get_tag },
37993747 {"get_suffixes" , imp_get_suffixes , METH_NOARGS , doc_get_suffixes },
3800- {"load_module" , imp_load_module , METH_VARARGS , doc_load_module },
38013748 {"lock_held" , imp_lock_held , METH_NOARGS , doc_lock_held },
38023749 {"acquire_lock" , imp_acquire_lock , METH_NOARGS , doc_acquire_lock },
38033750 {"release_lock" , imp_release_lock , METH_NOARGS , doc_release_lock },
0 commit comments