summaryrefslogtreecommitdiffstats
path: root/Python/import.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix compiler warning related to issue #14331. harmless.Gregory P. Smith2012-04-181-1/+2
|
* Fixes Issue #14331: Use significantly less stack space when importing modules byGregory P. Smith2012-03-181-31/+95
| | | | allocating path buffers on the heap instead of the stack.
* Test in 6c218b9c5c4c was inadvertently converted from #ifdef to #if. Now ↵Jason R. Coombs2012-03-081-1/+1
| | | | #ifdef again.
* Fix indentationJason R. Coombs2012-01-131-16/+16
|
* Extracted Windows directory detection from NullImporter.__init__. This ↵Jason R. Coombs2012-01-131-47/+24
| | | | greatly simplifies the code and fixes issue6727.
* Moved directory detection into an isdir functionJason R. Coombs2012-01-131-28/+14
|
* Remove debug output, fix assert (hopefully) and exercise signedness issues a ↵Antoine Pitrou2012-01-251-7/+2
| | | | bit more.
* Fix temporary debug output (so, time_t is 8 bytes on some Windows builds)Antoine Pitrou2012-01-251-1/+1
|
* Temporary debug for Windows buildbots.Antoine Pitrou2012-01-251-0/+5
|
* Make guard more dynamic (apparently the size of a filesystem timestamp may ↵Antoine Pitrou2012-01-251-8/+8
| | | | vary under Windows).
* Issue #11235: Fix OverflowError when trying to import a source file whose ↵Antoine Pitrou2012-01-241-7/+4
| | | | modification time doesn't fit in a 32-bit timestamp.
* Issue #7732: Fix a crash on importing a module if a directory has the same nameVictor Stinner2011-09-231-3/+1
| | | | | | | | than a Python module (e.g. "__init__.py"): don't close the file twice. PyFile_FromFile() does also close the file if PyString_FromString() failed. It did already close the file on fill_file_fields() error (e.g. if the file is a directory).
* Fix the import machinery if there is an error on sys.path or sys.meta_pathVictor Stinner2011-09-151-4/+4
| | | | | | find_module() now raises a RuntimeError, instead of ImportError, on an error on sys.path or sys.meta_path because load_package() and import_submodule() returns None and clear the exception if a ImportError occurred.
* Remove unused variable if Python is build without threadsVictor Stinner2011-09-011-0/+2
|
* Turned out that if you used explicit relative import syntaxBrett Cannon2010-05-201-1/+2
| | | | | | | | | (e.g. from .os import sep) and it failed, import would still try the implicit relative import semantics of an absolute import (from os import sep). That's not right, so when level is negative, only do explicit relative import semantics. Fixes issue #7902. Thanks to Meador Inge for the patch.
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-2394/+2394
|
* Fix whitespace.Brett Cannon2010-05-051-8/+8
|
* Partially revert the over-reaching r80813.Brett Cannon2010-05-051-8/+8
|
* Remove three unneeded variable assignments.Brett Cannon2010-05-051-8/+8
| | | | Found using Clang's static analyzer.
* make naming convention consistentBenjamin Peterson2010-03-251-2/+2
|
* Issue #3137: Don't ignore errors at startup, especially a keyboard interruptVictor Stinner2010-03-101-2/+0
| | | | | | (SIGINT). If an error occurs while importing the site module, the error is printed and Python exits. Initialize the GIL before importing the site module.
* Issue #7242: On Solaris 9 and earlier calling os.fork() from within aGregory P. Smith2010-03-011-4/+8
| | | | | thread could raise an incorrect RuntimeError about not holding the import lock. The import lock is now reinitialized after fork.
* Issue #2333: Backport set and dict comprehensions syntax.Alexandre Vassalotti2010-01-111-1/+2
|
* Issue #2335: Backport set literals syntax from Python 3.x.Alexandre Vassalotti2010-01-091-1/+2
|
* Fix issue #1590864, multiple threads and fork() can cause deadlocks, byThomas Wouters2009-09-161-19/+12
| | | | | | | | | | | | | | | | | | | | | | acquiring the import lock around fork() calls. This prevents other threads from having that lock while the fork happens, and is the recommended way of dealing with such issues. There are two other locks we care about, the GIL and the Thread Local Storage lock. The GIL is obviously held when calling Python functions like os.fork(), and the TLS lock is explicitly reallocated instead, while also deleting now-orphaned TLS data. This only fixes calls to os.fork(), not extension modules or embedding programs calling C's fork() directly. Solving that requires a new set of API functions, and possibly a rewrite of the Python/thread_*.c mess. Add a warning explaining the problem to the documentation in the mean time. This also changes behaviour a little on AIX. Before, AIX (but only AIX) was getting the import lock reallocated, seemingly to avoid this very same problem. This is not the right approach, because the import lock is a re-entrant one, and reallocating would do the wrong thing when forking while holding the import lock. Will backport to 2.6, minus the tiny AIX behaviour change.
* Better name a variable: 'buf' seems to imply a mutable buffer.Amaury Forgeot d'Arc2009-07-251-7/+7
|
* Update issue 6070 patch to match the patch that was actually testedR. David Murray2009-07-071-1/+3
| | | | on Windows.
* Issue 6070: when creating a compiled file, after copying the mode bits, onR. David Murray2009-07-071-1/+3
| | | | | posix zap the execute bit in case it was set on the .py file, since the compiled files are not directly executable on posix. Patch by Marco N.
* add a SETUP_WITH opcodeBenjamin Peterson2009-05-251-1/+2
| | | | | It speeds up the with statement and correctly looks up the special methods involved.
* Fix two issues introduced by issue #71031 by changing the signature ofBrett Cannon2009-04-021-1/+1
| | | | PyImport_AppendInittab() to take a const char *.
* PyImport_AppendInittab() took a char * as a first argument even though thatBrett Cannon2009-04-021-1/+1
| | | | | | | string was stored beyond the life of the call. Changed the signature to be const char * to help make this point. Closes issue #1419652.
* Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} withJeffrey Yasskin2009-02-281-1/+3
| | | | | | POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing a POP_TOP on each conditional and sometimes allows the peephole optimizer to skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly.
* Issue 3677: Fix import from UNC paths on Windows.Kristján Valur Jónsson2009-01-091-15/+19
|
* Issue #1180193: When importing a module from a .pyc (or .pyo) file withAntoine Pitrou2009-01-061-0/+45
| | | | | | | an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the file has been renamed, moved, or if it is accessed through different paths). Patch by Ziga Seilnacht and Jean-Paul Calderone.
* Issue #4817: Remove unused function PyOS_GetLastModificationTime.Martin v. Löwis2009-01-031-2/+0
|
* Issue #2183: Simplify and optimize bytecode for list comprehensions.Antoine Pitrou2008-12-171-1/+2
|
* Fix compilation when --without-threads is given #3683Benjamin Peterson2008-09-011-1/+4
| | | | Reviewer: Georg Brandl, Benjamin Peterson
* Add imp.reload(). This to help with transitioning to 3.0 the reload() built-inBrett Cannon2008-08-061-0/+13
| | | | has been removed there.
* Fix issue 3221 by emitting a RuntimeWarning instead of raising SystemError ↵Nick Coghlan2008-07-131-3/+22
| | | | when the parent module can't be found during an absolute import (likely due to non-PEP 361 aware code which sets a module level __package__ attribute)
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-34/+34
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-34/+34
|
* Build bots are working again - removing the hackChristian Heimes2008-03-271-1/+1
|
* Quick 'n dirty hack: Increase the magic by 2 to force a rebuild of pyc/pyo ↵Christian Heimes2008-03-271-1/+1
| | | | files on the build bots
* Initialize PyCompilerFlags cf_flags with 0Christian Heimes2008-03-261-0/+2
|
* Patch #2477: Added from __future__ import unicode_literalsChristian Heimes2008-03-261-1/+2
| | | | The new PyParser_*Ex() functions are based on Neal's suggestion and initial patch. The new __future__ feature makes all '' and r'' unicode strings. b'' and br'' stay (byte) strings.
* Speed up with statements by storing the __exit__ method on the stack instead ↵Nick Coghlan2008-03-071-1/+2
| | | | of in a temp variable (bumps the magic number for pyc files)
* MS Windows doesn't have mode_t but stat.st_mode is defined as unsigned short.Christian Heimes2008-02-231-0/+5
|
* Issue #2051 and patch from Alexander Belopolsky:Christian Heimes2008-02-231-13/+14
| | | | Permission for pyc and pyo files are inherited from the py file.
* Fixed some references leaks in sys.Christian Heimes2008-01-301-0/+2
|
* Fixed #1776. __import__() no longer imports modules by file nameChristian Heimes2008-01-091-0/+10
|