summaryrefslogtreecommitdiffstats
path: root/Python/import.c
Commit message (Collapse)AuthorAgeFilesLines
* SF patch #1035498: -m option to run a module as a scriptRaymond Hettinger2004-10-071-0/+16
| | | | (Contributed by Nick Coghlan.)
* Fix for SF bug #1029475 : reload() doesn't work with PEP 302 loaders.Phillip J. Eby2004-09-231-4/+10
|
* SF patch #1031667: Fold tuples of constants into a single constantRaymond Hettinger2004-09-221-1/+2
| | | | | | | | Example: >>> import dis >>> dis.dis(compile('1,2,3', '', 'eval')) 0 0 LOAD_CONST 3 ((1, 2, 3)) 3 RETURN_VALUE
* SF Patch #1013667: Cleanup Peepholer OutputRaymond Hettinger2004-08-231-1/+2
| | | | | | | | | * Make a pass to eliminate NOPs. Produce code that is more readable, more compact, and a tiny bit faster. Makes the peepholer more flexible in the scope of allowable transformations. * With Guido's okay, bumped up the magic number so that this patch gets widely exercised before the alpha goes out.
* PyImport_ExecCodeModuleEx(): remove module from sys.modules in error cases.Tim Peters2004-08-021-16/+46
| | | | | | | | PyImport_ReloadModule(): restore the module to sys.modules in error cases. load_package(): semantic-neutral refactoring from an earlier stab at this patch; giving it a common error exit made the code easier to follow, so retaining that part. _RemoveModule(): new little utility to delete a key from sys.modules.
* lock_held() docs: Use True/False instead of 1/0. The LaTeX docs wereTim Peters2004-08-011-3/+3
| | | | already correct, so not changed here.
* Trimmed trailing whitespace.Tim Peters2004-08-011-2/+2
|
* Patch #923098: Share interned strings in marshal.Martin v. Löwis2004-06-271-9/+9
|
* Fix a refcount bug in an obscure code corner.Thomas Heller2004-06-071-0/+1
| | | | Already backported.
* starting to add comments to explain what's hereFred Drake2004-05-281-0/+11
|
* Bump the magic number to avoid sharing bytecode between 2.3 and 2.4.Jeremy Hylton2004-04-011-32/+14
| | | | | Revise the long comment that explained details of the magic number in gory detail.
* Marshal clean-up (SF patch #873224)Armin Rigo2004-03-261-7/+7
|
* Changed random calls to PyThreadState_Get() to use the macroNicholas Bastin2004-03-241-2/+2
|
* Decref all if ensure_fromlist fails. Fixes #876533.Martin v. Löwis2004-03-231-2/+3
| | | | Backported to 2.3.
* Add comment to mollify Tim.Jeremy Hylton2004-01-021-0/+2
|
* Getting rid of all the code inside #ifdef macintosh too.Jack Jansen2003-11-201-94/+0
|
* Fix a bunch of typos in documentation, docstrings and comments.Walter Dörwald2003-10-201-1/+1
| | | | (From SF patch #810751)
* Bug #794140: cygwin builds do not embedJason Tishler2003-09-041-1/+1
| | | | | | The embed2.diff patch solves the user's problem by exporting the missing symbols from the Python core so Python can be embedded in another Cygwin application (well, at lest vim).
* - fix typoFred Drake2003-07-111-1/+1
| | | | | - there's a weird variable name here (zimpimport), but I'll leave that for someone that's familiar with the ZIP import support
* Don't use the module object setattr when importing submodules. Instead,Neil Schemenauer2003-06-161-18/+38
| | | | | | operate on the module dictionary directly. This prevents spurious depreciation warnings from being raised if a submodule name shadows a builtin name.
* SF patch #708201, unchecked return value in import.c by Jason HarperNeal Norwitz2003-03-231-0/+2
| | | | Will backport.
* Remove PyArg_ParseTuple() for methods which take no args,Neal Norwitz2003-02-171-23/+13
| | | | use METH_NOARGS instead
* Cleanup from patch #683257:Neal Norwitz2003-02-121-4/+7
| | | | | | | Add missing INCREFs and re-indent returns to be consistent. Add \n\ for lines in docstring Add a pathetic test Add docs
* Provide access to the import lock, fixing SF bug #580952. This isGuido van Rossum2003-02-121-6/+52
| | | | | | | | mostly from SF patch #683257, but I had to change unlock_import() to return an error value to avoid fatal error. Should this be backported? The patch requested this, but it's a new feature.
* MacPython-OS9 specific fix: If there are non-string items on sys.path don't ↵Jack Jansen2003-01-241-15/+18
| | | | try to intern them. This has the theoretical problem that resource filenames on sys.path cannot be unicode objects, but in practice that shouldn't matter.
* PEP 302 + zipimport:Just van Rossum2002-12-301-19/+236
| | | | | | | | | | | | | - new import hooks in import.c, exposed in the sys module - new module called 'zipimport' - various changes to allow bootstrapping from zip files I hope I didn't break the Windows build (or anything else for that matter), but then again, it's been sitting on sf long enough... Regarding the latest discussions on python-dev: zipimport sets pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as /path/to/Archive.zip/subdir/ are supported again.
* Backing out patch #642578 in anticipation of final acceptance of PEP 302.Just van Rossum2002-12-251-147/+0
|
* Added missing casts.Jack Jansen2002-12-131-2/+2
|
* Patch #614055: Support OpenVMS.Martin v. Löwis2002-12-061-2/+5
|
* Slightly improved version of patch #642578: "Expose PyImport_FrozenModulesJust van Rossum2002-11-291-0/+147
| | | | | in imp". This adds two functions to the imp module: get_frozenmodules() and set_frozenmodules().
* Because MWH changed the bytecode again, moved the magic number *back*Guido van Rossum2002-08-311-1/+6
| | | | | to 62011. This should get the snake-farm to throw away its old .pyc files, amongst others.
* This is my patchMichael W. Hudson2002-08-151-1/+5
| | | | | | | | [ 587993 ] SET_LINENO killer Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab. Many sundry changes to document and adapt to this change.
* Patch #569753: Remove support for WIN16.Martin v. Löwis2002-06-301-5/+5
| | | | Rename all occurrences of MS_WIN32 to MS_WINDOWS.
* Apply diff2.txt from SF patch http://www.python.org/sf/566999Walter Dörwald2002-06-171-7/+29
| | | | | | | | This patch enhances Python/import.c/find_module() so that unicode objects found in sys.path will be treated as legal directory names (The current code ignores anything that is not a str). The unicode name is converted to str using Py_FileSystemDefaultEncoding.
* Fix SF bug # 561858 Assertion with very long listsNeal Norwitz2002-06-141-2/+2
| | | | | Write 4 bytes for co_stacksize, etc. to prevent writing out bad .pyc files which can cause a crash when read back in.
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-28/+21
|
* imp_load_module(): correct and comment the sense of the test for '+'Guido van Rossum2002-05-301-2/+7
| | | | in the mode (it's forbidden).
* Cover a few corners in the 'U' mode integration to make imp work.Jeremy Hylton2002-05-301-8/+14
| | | | | | | | | get_file() must convert 'U' to "r" PY_STDIOTEXTMODE before calling fopen(). imp_load_module() must accept 'r' or 'U' or something with '+'. Also reflow some long lines.
* File modes in filedescr entries are also passed to Python, so we now put "U"Jack Jansen2002-05-281-4/+7
| | | | | | | in there, and convert it to "rb" (or "r" for non-universal-newline builds) before passing it to fopen(). Fixes #561326.
* Mass checkin of universal newline support.Jack Jansen2002-04-141-3/+3
| | | | | | | | Highlights: import and friends will understand any of \r, \n and \r\n as end of line. Python file input will do the same if you use mode 'U'. Everything can be disabled by configuring with --without-universal-newlines. See PEP278 for details.
* Got rid of ifdefs for long-obsolete GUSI versions.Jack Jansen2002-04-111-21/+0
|
* is_builtin() is not a Boolean -- it can return -1, 0, 1. [SF #541652]Guido van Rossum2002-04-091-1/+1
|
* Return bools from functions named is_<whatever>().Guido van Rossum2002-04-071-4/+4
|
* Use symbolic METH_VARARGS instead of 1 for ml_flagsNeal Norwitz2002-03-311-16/+16
|
* Remove the CACHE_HASH and INTERN_STRINGS preprocessor symbols.Tim Peters2002-03-291-2/+0
|
* OS/2 EMX port changes (Python part of patch #450267):Andrew MacIntyre2002-02-261-0/+76
| | | | | | | | | Python/ dynload_shlib.c // EMX port emulates dlopen() etc. for DL extensions import.c // changes to support 8.3 DLL name limit (VACPP+EMX) // and case sensitive import semantics importdl.h thread_os2.h
* Fix to the UTF-8 encoder: it failed on 0-length input strings.Marc-André Lemburg2002-02-071-1/+20
| | | | | | | | | | | | | | Fix for the UTF-8 decoder: it will now accept isolated surrogates (previously it raised an exception which causes round-trips to fail). Added new tests for UTF-8 round-trip safety (we rely on UTF-8 for marshalling Unicode objects, so we better make sure it works for all Unicode code points, including isolated surrogates). Bumped the PYC magic in a non-standard way -- please review. This was needed because the old PYC format used illegal UTF-8 sequences for isolated high surrogates which now raise an exception.
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-121-4/+0
|
* Since the MAGIC number scheme is going to break on January 1st, documentTim Peters2001-11-181-4/+16
| | | | what it is more carefully and point out some of the subtleties.
* On the macintosh don't take a quick exit in find_module() for frozen ↵Jack Jansen2001-10-301-0/+8
| | | | submodule imports: the frozen import goes through a different mechanism.