From c172f26861415ea7ec94df92e47564f00fc153cc Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 9 Sep 1997 20:54:35 +0000 Subject: [PATCH] Deleted find_module_in_package and find_module_in_directory -- they aren't needed and it was a mistake to add them. --- Python/import.c | 53 ------------------------------------------------- 1 file changed, 53 deletions(-) diff --git a/Python/import.c b/Python/import.c index 2192afaa618..f9cd6b40ae6 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1787,61 +1787,8 @@ imp_new_module(self, args) return PyModule_New(name); } -static PyObject * -imp_find_module_in_package(self, args) - PyObject *self; - PyObject *args; -{ - char *name; - PyObject *packagename = NULL; - PyObject *package; - PyObject *modules; - PyObject *path; - - if (!PyArg_ParseTuple(args, "s|S", &name, &packagename)) - return NULL; - if (packagename == NULL || PyString_GET_SIZE(packagename) == 0) { - return call_find_module(name, (PyObject *)NULL); - } - modules = PyImport_GetModuleDict(); - package = PyDict_GetItem(modules, packagename); - if (package == NULL) { - PyErr_Format(PyExc_ImportError, - "No package named %.200s", - PyString_AS_STRING(packagename)); - return NULL; - } - path = PyObject_GetAttrString(package, "__path__"); - if (path == NULL) { - PyErr_Format(PyExc_ImportError, - "Package %.200s has no __path__ attribute", - PyString_AS_STRING(packagename)); - return NULL; - } - return call_find_module(name, path); -} - -static PyObject * -imp_find_module_in_directory(self, args) - PyObject *self; - PyObject *args; -{ - char *name; - PyObject *directory; - PyObject *path; - - if (!PyArg_ParseTuple(args, "sS", &name, &directory)) - return NULL; - path = Py_BuildValue("[O]", directory); - if (path == NULL) - return NULL; - return call_find_module(name, path); -} - static PyMethodDef imp_methods[] = { {"find_module", imp_find_module, 1}, - {"find_module_in_directory", imp_find_module_in_directory, 1}, - {"find_module_in_package", imp_find_module_in_package, 1}, {"get_frozen_object", imp_get_frozen_object, 1}, {"get_magic", imp_get_magic, 1}, {"get_suffixes", imp_get_suffixes, 1},