summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Argh. "integer" is a very confusing word ;)Georg Brandl2006-06-081-2/+2
| | | | | Actually, checking for INT_MAX and INT_MIN is correct since the format code explicitly handles a C "int".
* Bug #1502750: Fix getargs "i" format to use LONG_MIN and LONG_MAX for bounds ↵Georg Brandl2006-06-081-2/+2
| | | | checking.
* _PySys_Init(): It's rarely a good idea to size a buffer to theTim Peters2006-06-061-1/+1
| | | | | | | | exact maximum size someone guesses is needed. In this case, if we're really worried about extreme integers, then "cp%d" can actually need 14 bytes (2 for "cp" + 1 for \0 at the end + 11 for -(2**31-1)). So reserve 128 bytes instead -- nothing is actually saved by making a stack-local buffer tiny.
* Add 3 more bytes to a buffer to cover constants in string and null byte on ↵Brett Cannon2006-06-051-1/+1
| | | | | | top of 10 possible digits for an int. Closes bug #1501223.
* Revert revisions:Tim Peters2006-06-044-170/+4
| | | | | | | | | | | | | | | | 46640 Patch #1454481: Make thread stack size runtime tunable. 46647 Markup fix The first is causing many buildbots to fail test runs, and there are multiple causes with seemingly no immediate prospects for repairing them. See python-dev discussion. Note that a branch can (and should) be created for resolving these problems, like svn copy svn+ssh://svn.python.org/python/trunk -r46640 svn+ssh://svn.python.org/python/branches/NEW_BRANCH followed by merging rev 46647 to the new branch.
* Patch #1346214: correctly optimize away "if 0"-style stmtsGeorg Brandl2006-06-042-15/+49
| | | | (thanks to Neal for review)
* clean up function declarations to conform to PEP-7 style.Andrew MacIntyre2006-06-043-22/+44
|
* Patch #1454481: Make thread stack size runtime tunable.Andrew MacIntyre2006-06-044-4/+170
|
* [ 1497053 ] Let dicts propagate the exceptions in user __eq__().Armin Rigo2006-06-011-2/+13
| | | | [ 1456209 ] dictresize() vulnerability ( <- backport candidate ).
* Convert more modules to METH_VARARGS.Georg Brandl2006-05-291-5/+3
|
* Make use of METH_O and METH_NOARGS where possible.Georg Brandl2006-05-291-2/+2
| | | | Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
* Fix compiler warning.Georg Brandl2006-05-291-1/+1
|
* Handle PyMem_Malloc failure in pystrtod.c. Closes #1494671.Georg Brandl2006-05-291-0/+7
|
* Fix #1494605.Georg Brandl2006-05-291-1/+2
|
* 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.