[Python-checkins] python/dist/src/Python import.c,2.230,2.231
fdrake at users.sourceforge.net
fdrake at users.sourceforge.net
Fri May 28 16:21:39 EDT 2004
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6304
Modified Files:
import.c
Log Message:
starting to add comments to explain what's here
Index: import.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
retrieving revision 2.230
retrieving revision 2.231
diff -C2 -d -r2.230 -r2.231
*** import.c 1 Apr 2004 02:45:22 -0000 2.230
--- import.c 28 May 2004 20:21:36 -0000 2.231
***************
*** 1914,1917 ****
--- 1914,1928 ----
}
+ /* 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)
More information about the Python-checkins
mailing list