Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8759090

Browse files
committed
starting to add comments to explain what's here
1 parent 80ce6dd commit 8759090

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Python/import.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,17 @@ PyImport_ImportModuleEx(char *name, PyObject *globals, PyObject *locals,
19131913
return result;
19141914
}
19151915

1916+
/* Return the package that an import is being performed in. If globals comes
1917+
from the module foo.bar.bat (not itself a package), this returns the
1918+
sys.modules entry for foo.bar. If globals is from a package's __init__.py,
1919+
the package's entry in sys.modules is returned.
1920+
1921+
The *name* of the returned package is returned in buf, with the length of
1922+
the name in *p_buflen.
1923+
1924+
If globals doesn't come from a package or a module in a package, or a
1925+
corresponding entry is not found in sys.modules, Py_None is returned.
1926+
*/
19161927
static PyObject *
19171928
get_parent(PyObject *globals, char *buf, int *p_buflen)
19181929
{

0 commit comments

Comments
 (0)