summaryrefslogtreecommitdiff
path: root/Python/import.c
AgeCommit message (Collapse)AuthorLines
2006-10-05[Backport r50743 | neal.norwitz]Andrew M. Kuchling-2/+7
Handle allocation failures gracefully. Found with failmalloc. Many (all?) of these could be backported.
2006-10-05[Backport r51247 | neal.norwitz]Andrew M. Kuchling-1/+6
cpathname could be NULL if it was longer than MAXPATHLEN. Don't try to write the .pyc to NULL. Check results of PyList_GetItem() and PyModule_GetDict() are not NULL. Klocwork 282, 283, 285
2006-10-03[Backport r50678 | neal.norwitz]Andrew M. Kuchling-7/+9
Fix memory leak under some conditions. Reported by Klocwork, #98.
2006-09-27[Backport of rev. 42093 by neal.norwitz]Andrew M. Kuchling-0/+2
Check return result from Py_InitModule*(). This API can fail. Probably should be backported.
2005-10-03Backport:Neal Norwitz-1/+5
Fix SF bug #976608, Unhelpful error message when mtime of a module is -1
2005-09-14- Changes donated by Elemental Security to make it work on AIX 5.3Guido van Rossum-0/+12
with IBM's 64-bit compiler (SF patch #1284289). This also closes SF bug #105470: test_pwd fails on 64bit system (Opteron).
2005-09-14Backport of patch #1290454: Fix reload() error message when parent is notGeorg Brandl-2/+3
in sys.modules.
2004-10-07SF patch #1035498: -m option to run a module as a scriptRaymond Hettinger-0/+16
(Contributed by Nick Coghlan.)
2004-09-23Fix for SF bug #1029475 : reload() doesn't work with PEP 302 loaders.Phillip J. Eby-4/+10
2004-09-22SF patch #1031667: Fold tuples of constants into a single constantRaymond Hettinger-1/+2
Example: >>> import dis >>> dis.dis(compile('1,2,3', '', 'eval')) 0 0 LOAD_CONST 3 ((1, 2, 3)) 3 RETURN_VALUE
2004-08-23SF Patch #1013667: Cleanup Peepholer OutputRaymond Hettinger-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.
2004-08-02PyImport_ExecCodeModuleEx(): remove module from sys.modules in error cases.Tim Peters-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.
2004-08-01lock_held() docs: Use True/False instead of 1/0. The LaTeX docs wereTim Peters-3/+3
already correct, so not changed here.
2004-08-01Trimmed trailing whitespace.Tim Peters-2/+2
2004-06-27Patch #923098: Share interned strings in marshal.Martin v. Löwis-9/+9
2004-06-07Fix a refcount bug in an obscure code corner.Thomas Heller-0/+1
Already backported.
2004-05-28starting to add comments to explain what's hereFred Drake-0/+11
2004-04-01Bump the magic number to avoid sharing bytecode between 2.3 and 2.4.Jeremy Hylton-30/+12
Revise the long comment that explained details of the magic number in gory detail.
2004-03-26Marshal clean-up (SF patch #873224)Armin Rigo-7/+7
2004-03-24Changed random calls to PyThreadState_Get() to use the macroNicholas Bastin-2/+2
2004-03-23Decref all if ensure_fromlist fails. Fixes #876533.Martin v. Löwis-2/+3
Backported to 2.3.
2004-01-02Add comment to mollify Tim.Jeremy Hylton-0/+2
2003-11-20Getting rid of all the code inside #ifdef macintosh too.Jack Jansen-94/+0
2003-10-20Fix a bunch of typos in documentation, docstrings and comments.Walter Dörwald-1/+1
(From SF patch #810751)
2003-09-04Bug #794140: cygwin builds do not embedJason Tishler-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).
2003-07-11- fix typoFred Drake-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
2003-06-16Don't use the module object setattr when importing submodules. Instead,Neil Schemenauer-18/+38
operate on the module dictionary directly. This prevents spurious depreciation warnings from being raised if a submodule name shadows a builtin name.
2003-03-23SF patch #708201, unchecked return value in import.c by Jason HarperNeal Norwitz-0/+2
Will backport.
2003-02-17Remove PyArg_ParseTuple() for methods which take no args,Neal Norwitz-23/+13
use METH_NOARGS instead
2003-02-12Cleanup from patch #683257:Neal Norwitz-4/+7
Add missing INCREFs and re-indent returns to be consistent. Add \n\ for lines in docstring Add a pathetic test Add docs
2003-02-12Provide access to the import lock, fixing SF bug #580952. This isGuido van Rossum-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.
2003-01-24MacPython-OS9 specific fix: If there are non-string items on sys.path don't ↵Jack Jansen-14/+17
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.
2002-12-30PEP 302 + zipimport:Just van Rossum-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.
2002-12-25Backing out patch #642578 in anticipation of final acceptance of PEP 302.Just van Rossum-147/+0
2002-12-13Added missing casts.Jack Jansen-2/+2
2002-12-06Patch #614055: Support OpenVMS.Martin v. Löwis-2/+5
2002-11-29Slightly improved version of patch #642578: "Expose PyImport_FrozenModulesJust van Rossum-0/+147
in imp". This adds two functions to the imp module: get_frozenmodules() and set_frozenmodules().
2002-08-31Because MWH changed the bytecode again, moved the magic number *back*Guido van Rossum-1/+6
to 62011. This should get the snake-farm to throw away its old .pyc files, amongst others.
2002-08-15This is my patchMichael W. Hudson-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.
2002-06-30Patch #569753: Remove support for WIN16.Martin v. Löwis-5/+5
Rename all occurrences of MS_WIN32 to MS_WINDOWS.
2002-06-17Apply diff2.txt from SF patch http://www.python.org/sf/566999Walter Dörwald-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.
2002-06-14Fix SF bug # 561858 Assertion with very long listsNeal Norwitz-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.
2002-06-13Patch #568124: Add doc string macros.Martin v. Löwis-28/+21
2002-05-30imp_load_module(): correct and comment the sense of the test for '+'Guido van Rossum-2/+7
in the mode (it's forbidden).
2002-05-30Cover a few corners in the 'U' mode integration to make imp work.Jeremy Hylton-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.
2002-05-28File modes in filedescr entries are also passed to Python, so we now put "U"Jack Jansen-4/+7
in there, and convert it to "rb" (or "r" for non-universal-newline builds) before passing it to fopen(). Fixes #561326.
2002-04-14Mass checkin of universal newline support.Jack Jansen-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.
2002-04-11Got rid of ifdefs for long-obsolete GUSI versions.Jack Jansen-21/+0
2002-04-09is_builtin() is not a Boolean -- it can return -1, 0, 1. [SF #541652]Guido van Rossum-1/+1
2002-04-07Return bools from functions named is_<whatever>().Guido van Rossum-4/+4