Index: Doc/c-api/import.rst =================================================================== --- Doc/c-api/import.rst (revision 60941) +++ Doc/c-api/import.rst (working copy) @@ -160,7 +160,18 @@ Return the dictionary used for the module administration (a.k.a. ``sys.modules``). Note that this is a per-interpreter variable. +.. cfunction:: PyObject* PyImport_GetImporter(PyObject *path) + Return an importer object for a :attr:`sys.path`/:attr:`pkg.__path__` item *path*, + possibly by fetching it from the :attr:`sys.path_importer_cache` dict. If it + wasn't yet cached, traverse :attr:`sys.path_hooks` until a hook is found + that can handle the path item. Return ``None`` if no hook could; + this tells our caller it should fall back to the builtin + import mechanism. Cache the result in :attr:`sys.path_importer_cache`. + Return a new reference to the importer object. + + .. versionadded:: 2.6 + .. cfunction:: void _PyImport_Init() Initialize the import mechanism. For internal use only.