]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
starting to add comments to explain what's here
authorFred Drake <fdrake@acm.org>
Fri, 28 May 2004 20:21:36 +0000 (20:21 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 28 May 2004 20:21:36 +0000 (20:21 +0000)
Python/import.c

index 5143a600eb74aacfbfbb88f77af4a286055493f0..030142ad8f7e6378ec8e4fa684fcee7c05c614ed 100644 (file)
@@ -1913,6 +1913,17 @@ PyImport_ImportModuleEx(char *name, PyObject *globals, PyObject *locals,
        return result;
 }
 
+/* Return the package that an import is being performed in.  If globals comes
+   from the module foo.bar.bat (not itself a package), this returns the
+   sys.modules entry for foo.bar.  If globals is from a package's __init__.py,
+   the package's entry in sys.modules is returned.
+
+   The *name* of the returned package is returned in buf, with the length of
+   the name in *p_buflen.
+
+   If globals doesn't come from a package or a module in a package, or a
+   corresponding entry is not found in sys.modules, Py_None is returned.
+*/
 static PyObject *
 get_parent(PyObject *globals, char *buf, int *p_buflen)
 {