| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
"from blah import (foo, bar
baz, bongo)"
|
| |
|
|
|
|
|
|
|
|
| |
Allows the lineno fixup code to remain simple and not have to deal with
multibyte codings.
* Add an assertion to that effect.
* Remove the XXX comment on the subject.
|
| |
|
|
|
|
| |
Will backport to 2.3.
|
|
|
|
| |
(Suggested by Neal Norwitz.)
|
|
|
|
|
|
|
| |
happen in 2.3, but nobody noticed it still was getting generated (the
warning was disabled by default). OverflowWarning and
PyExc_OverflowWarning should be removed for 2.5, and left notes all over
saying so.
|
|
|
|
|
|
|
|
|
| |
* Perform the code length check earlier.
* Eliminate the extra PyMem_Free() upon hitting an EXTENDED_ARG.
* Assert that the NOP count used in jump retargeting matches the NOPs
eliminated in the final step.
* Add an XXX note to indicate that more work is being to done to
handle linenotab with intervals > 255.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
files and not re-optimized upon import. Saves a bit of startup time while
still remaining decoupled from the rest of the compiler.
As a side benefit, handcoded bytecode is not run through the optimizer
when new code objects are created. Hopefully, a handcoder has already
created exactly what they want to have run.
(Idea suggested by Armin Rigo and Michael Hudson. Initially avoided
because of worries about compiler coupling; however, only the nexus
point needed to be moved so there won't be a conflict when the AST
branch is loaded.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ 1009560 ] Fix @decorator evaluation order
From the description:
Changes in this patch:
- Change Grammar/Grammar to require
newlines between adjacent decorators.
- Fix order of evaluation of decorators
in the C (compile.c) and python
(Lib/compiler/pycodegen.py) compilers
- Add better order of evaluation check
to test_decorators.py (test_eval_order)
- Update the decorator documentation in
the reference manual (improve description
of evaluation order and update syntax
description)
and the comment:
Used Brett's evaluation order (see
http://mail.python.org/pipermail/python-dev/2004-August/047835.html)
(I'm checking this in for Anthony who was having problems getting SF to
talk to him)
|
|
|
|
|
|
|
|
|
|
| |
because GNU/k*BSD uses gnu pth to provide pthreads, but will also happen on any
system that does the same.
python fails to build because it doesn't detect gnu pth in pthread
emulation. See C comments in patch for details.
patch taken from http://bugs.debian.org/264315
|
|
|
|
| |
top-down. Now matches the PEP.
|
| |
|
|
|
|
|
|
| |
[ 1005891 ] support --with-tsc on PPC
plus a trivial change to settscdump's docstring and a Misc/NEWS entry.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
[ 1005248 ] new.code() not cleanly checking its arguments
using the result of new.code() can still destroy the sun, but merely
calling the function shouldn't any more.
I also rewrote the existing tests of new.code() to use vastly less
un-bogus arguments, and added tests for the previous insane behaviours.
|
| |
|
|
|
|
|
|
| |
hack: it would resize *interned* strings in-place! This occurred because
their reference counts do not have their expected value -- stringobject.c
hacks them. Mea culpa.
|
|
|
|
|
|
|
|
|
|
|
| |
interning were not clear here -- a subclass could be mutable, for
example -- and had bugs. Explicitly interning a subclass of string
via intern() will raise a TypeError. Internal operations that attempt
to intern a string subclass will have no effect.
Added a few tests to test_builtin that includes the old buggy code and
verifies that calls like PyObject_SetAttr() don't fail. Perhaps these
tests should have gone in test_string.
|
|
|
|
|
|
|
|
|
| |
[ 991812 ] PyArg_ParseTuple can miss errors with warnings as exceptions
as suggested in the report.
This is definitely a 2.3 candidate (as are most of the checkins I've
made in the last month...)
|
|
|
|
| |
Will backport.
|
|
|
|
| |
(Original patch by Armin Rigo).
|
|
|
|
| |
.pyc size) after all.
|
|
|
|
|
| |
Hard to believe it ever helped anything, and it hurts finding reference
leaks.
|
|
|
|
|
|
|
| |
have differing refcount semantics. If anyone sees a prettier way to
acheive the same ends, then please go for it.
I think this is the first time I've ever used Py_XINCREF.
|
|
|
|
| |
must have annoyed me at some point.
|
| |
|
|
|
|
|
|
|
| |
* Fixes an incorrect variable in a PyDict_CheckExact.
* Allow general mapping locals arguments for the execfile() function
and exec statement.
* Add tests.
|
|
|
|
|
| |
"@ seems the syntax that everybody can hate equally"
Implementation by Mark Russell, from SF #979728.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
already correct, so not changed here.
|
| |
|
|
|
|
| |
Backported to 2.3.
|
|
|
|
|
|
| |
__oct__, and __hex__. Raise TypeError if an invalid type is
returned. Note that PyNumber_Int and PyNumber_Long can still
return ints or longs. Fixes SF bug #966618.
|
| |
|
|
|
|
|
|
| |
The preceding case statement was missing a terminating "break" stmt,
so fell into the new code by mistake. This caused uncaught out-of-bounds
accesses to the "names" tuple, leading to a variety of insane behaviors.
|
| |
|
|
|
|
|
|
| |
expected entrypoint. The unlinking will crash the application if the
module contained ObjC code. The price of this is small: a little wasted
memory, and only in a case than isn't expected to occur often.
|
|
|
|
| |
it is used, and made it private. Should fix #978662.
|
|
|
|
|
|
|
|
| |
[ 984722 ] Py_BuildValue loses reference counts on error
I'm ever-so-slightly uneasy at the amount of work this can do with an
exception pending, but I don't think that this can result in anything
more serious than a strange error message.
|
|
|
|
|
|
| |
PyArg_VaParse().
Closes patch #550732. Thanks Greg Chapman.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ 960406 ] unblock signals in threads
although the changes do not correspond exactly to any patch attached to
that report.
Non-main threads no longer have all signals masked.
A different interface to readline is used.
The handling of signals inside calls to PyOS_Readline is now rather
different.
These changes are all a bit scary! Review and cross-platform testing
much appreciated.
|
|
|
|
| |
* Add a test case that would have caught it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
table' of the dll, to make sure that the dll really was build for the
correct Python version. It does this by looking for an entry
'pythonXY.dll' (X.Y is the Python version number).
The code now checks the size of the dll's import table before reading
entries from it. Before this patch, the code crashed trying to read
the import table when the size was zero (as in Win2k's wmi.dll, for
example).
Look for imports of 'pythonXY_d.dll' in a debug build instead of
'pythonXY.dll'.
Fixes SF 951851: Crash when reading "import table" of certain windows dlls.
Already backported to the 2.3 branch.
|
|
|
|
|
|
| |
The builtin eval() function now accepts any mapping for the locals argument.
Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing
down the normal case. My timings so no measurable impact.
|
| |
|