summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Correct None refcount issue in Mac modules. (Are theyGeorg Brandl2006-05-281-1/+1
| | | | still used?)
* The empty string is a valid import path.Georg Brandl2006-05-281-2/+4
| | | | (fixes #1496539)
* PyErr_Display(), PyErr_WriteUnraisable(): Coverity found a cut-and-pasteTim Peters2006-05-282-18/+23
| | | | bug in both: `className` was referenced before being checked for NULL.
* Conversion of exceptions over from faked-up classes to new-style C types.Richard Jones2006-05-273-2056/+23
|
* needforspeed: backed out the Py_LOCAL-isation of ceval; the massive in-Fredrik Lundh2006-05-271-60/+55
| | | | | lining killed performance on certain Intel boxes, and the "aggressive" macro itself gives most of the benefits on others.
* Patch 1145039.Tim Peters2006-05-261-41/+56
| | | | | | | | | | | | | | | | | | | set_exc_info(), reset_exc_info(): By exploiting the likely (who knows?) invariant that when an exception's `type` is NULL, its `value` and `traceback` are also NULL, save some cycles in heavily-executed code. This is a "a kronar saved is a kronar earned" patch: the speedup isn't reliably measurable, but it obviously does reduce the operation count in the normal (no exception raised) path through PyEval_EvalFrameEx(). The tim-exc_sanity branch tries to push this harder, but is still blowing up (at least in part due to pre-existing subtle bugs that appear to have no other visible consequences!). Not a bugfix candidate.
* Replace Py_BuildValue("OO") by PyTuple_Pack.Georg Brandl2006-05-262-4/+4
|
* Need for speed: Patch #921466 : sys.path_importer_cache is now used to cache ↵Georg Brandl2006-05-261-2/+30
| | | | | | | | | | valid and invalid file paths for the built-in import machinery which leads to fewer open calls on startup. Also fix issue with PEP 302 style import hooks which lead to more open() calls than necessary.
* Py_LOCAL shouldn't be used for data; it works for some .NET 2003 compilers,Fredrik Lundh2006-05-261-1/+1
| | | | but Trent's copy thinks that it's an anachronism...
* needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"Fredrik Lundh2006-05-261-15/+23
| | | | LOCAL inlining; also added some missing whitespace
* needforspeed: added Py_LOCAL macro, based on the LOCAL macro usedFredrik Lundh2006-05-261-53/+53
| | | | | for SRE and others. applied Py_LOCAL to relevant portion of ceval, which gives a 1-2% speedup on my machine. ymmv.
* Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .Brett Cannon2006-05-251-2/+2
|
* Replace PyObject_CallFunction calls with only object argsGeorg Brandl2006-05-252-4/+4
| | | | with PyObject_CallFunctionObjArgs, which is 30% faster.
* A new table to help string->integer conversion was added yesterday toTim Peters2006-05-251-30/+2
| | | | | | both mystrtoul.c and longobject.c. Share the table instead. Also cut its size by 64 entries (they had been used for an inscrutable trick originally, but the code no longer tries to use that trick).
* Update graminit.c for the fix for #1488915, Multiple dots in relative importThomas Wouters2006-05-251-20/+15
| | | | statement raise SyntaxError, and add testcase.
* Replace tab inside comment with space.Walter Dörwald2006-05-251-1/+1
|
* Bug #1334662 / patch #1335972: int(string, base) wrong answers.Tim Peters2006-05-231-88/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In rare cases of strings specifying true values near sys.maxint, and oddball bases (not decimal or a power of 2), int(string, base) could deliver insane answers. This repairs all such problems, and also speeds string->int significantly. On my box, here are % speedups for decimal strings of various lengths: length speedup ------ ------- 1 12.4% 2 15.7% 3 20.6% 4 28.1% 5 33.2% 6 37.5% 7 41.9% 8 46.3% 9 51.2% 10 19.5% 11 19.9% 12 23.9% 13 23.7% 14 23.3% 15 24.9% 16 25.3% 17 28.3% 18 27.9% 19 35.7% Note that the difference between 9 and 10 is the difference between short and long Python ints on a 32-bit box. The patch doesn't actually do anything to speed conversion to long: the speedup is due to detecting "unsigned long" overflow more quickly. This is a bugfix candidate, but it's a non-trivial patch and it would be painful to separate the "bug fix" from the "speed up" parts.
* Applied patch 1337051 by Neal Norwitz, saving 4 ints on frame objects.Richard Jones2006-05-231-17/+17
|
* PyErr_NewException now accepts a tuple of base classes as itsGeorg Brandl2006-05-231-3/+10
| | | | "base" parameter.
* Patch #1492356: Port to Windows CE (patch set 1).Martin v. Löwis2006-05-221-2/+2
|
* Oops, I forgot to include this file in the last commit (46046):Neal Norwitz2006-05-191-2/+2
| | | | | | Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64. I suppose this could be backported if anyone cares.
* Fix #1474677, non-keyword argument following keyword.Neal Norwitz2006-05-191-0/+5
|
* Fix #132 from Coverity, retval could have been derefedNeal Norwitz2006-05-191-0/+4
| | | | if a continue inside a try failed.
* Remove bogus DECREF of self.Martin v. Löwis2006-05-151-65/+32
| | | | | Change __str__() functions to METH_O. Change WindowsError__str__ to use PyTuple_Pack.
* - Bug #1487966: Fix SystemError with conditional expression in assignmentNeal Norwitz2006-05-151-0/+3
| | | | Most of the test_syntax changes are just updating the numbers.
* Change WindowsError to carry the Win32 error code in winerror,Martin v. Löwis2006-05-111-4/+121
| | | | | and the DOS error code in errno. Revert changes where WindowsError catch blocks unnecessarily special-case OSError.
* Micro optimization. In the first case, we know that frame->f_exc_typeNeal Norwitz2006-05-091-3/+1
| | | | | is NULL, so there's no reason to do anything with it. In the second case, we know frame->f_exc_type is not NULL, so we can just do an INCREF.
* Get rid of __context__, per the latest changes to PEP 343 and python-devGuido van Rossum2006-05-021-10/+3
| | | | | | | | discussion. There are two places of documentation that still mention __context__: Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without spending a whole lot of time thinking about it; and whatsnew, which Andrew usually likes to change himself.
* SF #1479181: split open() and file() from being aliases for each other.Neal Norwitz2006-05-021-4/+14
|
* Fix a warning on ppc (debian)Neal Norwitz2006-04-281-4/+7
|
* Fix a warning on alphaNeal Norwitz2006-04-281-1/+1
|
* - Add new Warning class, ImportWarningThomas Wouters2006-04-272-7/+35
| | | | | | | | | | | | | | - Warn-raise ImportWarning when importing would have picked up a directory as package, if only it'd had an __init__.py. This swaps two tests (for case-ness and __init__-ness), but case-test is not really more expensive, and it's not in a speed-critical section. - Test for the new warning by importing a common non-package directory on sys.path: site-packages - In regrtest.py, silence warnings generated by the build-environment because Modules/ (which is added to sys.path for Setup-created modules) has 'zlib' and '_ctypes' directories without __init__.py's.
* Define MAXPATHLEN to be at least PATH_MAX, if that's defined. Python usesThomas Wouters2006-04-251-0/+4
| | | | | | | | | MAXPATHLEN-sized buffers for various output-buffers (like to realpath()), and that's correct on BSD platforms, but not Linux (which uses PATH_MAX, and does not define MAXPATHLEN.) Cursory googling suggests Linux is following a newer standard than BSD, but in cases like this, who knows. Using the greater of PATH_MAX and 1024 as a fallback for MAXPATHLEN seems to be the most portable solution.
* Fix more ssize_t issues.Martin v. Löwis2006-04-223-4/+4
|
* Teach Python/ceval.c's inlining of 'str += str' about Py_ssize_t sizes; thisThomas Wouters2006-04-191-2/+2
| | | | was having funny effects when called on >2Gb strings ;P
* Change those parts of the Python-api that were functions in 2.4, andThomas Heller2006-04-181-4/+96
| | | | | | are now macros to exported functions again. Fixes [ 1465834 ] bdist_wininst preinstall script support is broken in 2.5a1.
* Refactor: Move code that uses co_lnotab from ceval to codeobjectJeremy Hylton2006-04-181-117/+14
|
* Remove types from type_list if they have no objectsMartin v. Löwis2006-04-181-2/+9
| | | | | and unlist_types_without_objects is set. Give dump_counts a FILE* argument.
* C++ compiler cleanup: cast...Skip Montanaro2006-04-181-2/+2
|
* C++ compiler cleanup: extern "C" a couple declarations, cast int to size_tSkip Montanaro2006-04-181-1/+9
|
* C++ compiler cleanup: migrate to modsupport.hSkip Montanaro2006-04-181-3/+0
|
* This patches fixes a number of byteorder problems in MacOSX specific code.Ronald Oussoren2006-04-171-2/+6
|
* moduleName can be NULLNeal Norwitz2006-04-171-1/+1
|
* Add missing DECREF to PyErr_WriteUnraisable(). That function reportsThomas Wouters2006-04-151-0/+1
| | | | | | | | | | | exceptions that can't be raised any further, because (for instance) they occur in __del__ methods. The coroutine tests in test_generators was triggering this leak. Remove the leakers' testcase, and add a simpler testcase that explicitly tests this leak to test_generators. test_generators now no longer leaks at all, on my machine. This fix may also solve other leaks, but my full refleakhunting run is still busy, so who knows?
* Use Py_VISIT in all tp_traverse methods, instead of traversing manually orThomas Wouters2006-04-151-9/+3
| | | | | | | | using a custom, nearly-identical macro. This probably changes how some of these functions are compiled, which may result in fractionally slower (or faster) execution. Considering the nature of traversal, visiting much of the address space in unpredictable patterns, I'd argue the code readability and maintainability is well worth it ;P
* Zap ZAP.Martin v. Löwis2006-04-151-25/+18
|
* Use Py_CLEAR instead of in-place DECREF/XDECREF or custom macros, forThomas Wouters2006-04-151-4/+2
| | | | tp_clear methods.
* Fix sys.getobjects(0): we get a reference to theMartin v. Löwis2006-04-151-0/+3
| | | | | arena's "private" list of objects, so there might be two references to that list.
* Make Py_BuildValue, PyObject_CallFunction andMartin v. Löwis2006-04-143-25/+73
| | | | PyObject_CallMethod aware of PY_SSIZE_T_CLEAN.
* SF Bug #1454485, array.array('u') could crash the interpreter whenNeal Norwitz2006-04-141-5/+2
| | | | | | | | passing a string. Martin already fixed the actual crash by ensuring Py_UNICODE is unsigned. As discussed on python-dev, this fix removes the possibility of creating a unicode string from a raw buffer. There is an outstanding question of how to fix the crash in 2.4.