summaryrefslogtreecommitdiff
path: root/Python/importdl.h
AgeCommit message (Collapse)AuthorLines
1997-09-05First part of package support.Guido van Rossum-5/+10
This doesn't yet support "import a.b.c" or "from a.b.c import x", but it does recognize directories. When importing a directory, it initializes __path__ to a list containing the directory name, and loads the __init__ module if found. The (internal) find_module() and load_module() functions are restructured so that they both also handle built-in and frozen modules and Mac resources (and directories of course). The imp module's find_module() and (new) load_module() also have this functionality. Moreover, imp unconditionally defines constants for all module types, and has two more new functions: find_module_in_package() and find_module_in_directory(). There's also a new API function, PyImport_ImportModuleEx(), which takes all four __import__ arguments (name, globals, locals, fromlist). The last three may be NULL. This is currently the same as PyImport_ImportModule() but in the future it will be able to do relative dotted-path imports. Other changes: - bltinmodule.c: in __import__, call PyImport_ImportModuleEx(). - ceval.c: always pass the fromlist to __import__, even if it is a C function, so PyImport_ImportModuleEx() is useful. - getmtime.c: the function has a second argument, the FILE*, on which it applies fstat(). According to Sjoerd this is much faster. The first (pathname) argument is ignored, but remains for backward compatibility (so the Mac version still works without changes). By cleverly combining the new imp functionality, the full support for dotted names in Python (mini.py, not checked in) is now about 7K, lavishly commented (vs. 14K for ni plus 11K for ihooks, also lavishly commented). Good night!
1997-07-21Removed some variables that are used to exchange data between import.c andGuido van Rossum-3/+2
importdl.c: the MAXSUFFIXSIZE macro is now defined in importdl.h, and the modules dictionary is now passed using PyImport_GetModuleDict(). Also undefine USE_SHLIB for AIX -- in AIX 4.2 and up, dlfcn.h exists but we don't want to use it.
1997-05-14One last rename glitch: import_modules -> _PyImport_Modules.Guido van Rossum-1/+1
1997-04-29Quickly renamed the remaining files -- this directory is done.Guido van Rossum-4/+5
1996-10-25New permission notice, includes CNRI.Guido van Rossum-12/+19
1995-06-12Check if we've already loaded a dynamic module under a different name.Sjoerd Mullender-1/+1
1995-02-15Added hooks to support importing pyc code from a resource on the mac.Jack Jansen-1/+4
1995-01-04Added 1995 to copyright message.Guido van Rossum-2/+2
bltinmodule.c: fixed coerce() nightmare in ternary pow(). modsupport.c (initmodule2): pass METH_FREENAME flag to newmethodobject(). pythonrun.c: move flushline() into and around print_error().
1995-01-02Lots of changes, most minor (fatal() instead of abort(), use ofGuido van Rossum-0/+39
err_fetch/err_restore and so on). But... NOTE: import.c has been rewritten and all the DL stuff is now in the new file importdl.c.