| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
test_builtin.)
|
| |
|
|
|
|
| |
Re-enable all the tests in test_trace.py except one. Still not sure that these tests test what they used to test, but they pass. One failing test seems to be caused by undocumented line number table behavior in Python 2.4.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tracing/line number table in except blocks.
Reflow long lines introduced by col_offset changes. Update test_ast
to handle new fields in excepthandler.
As note in Python.asdl says, we might want to rethink how attributes
are handled. Perhaps they should be the same as other fields, with
the primary difference being how they are defined for all types within
a sum.
Also fix asdl_c so that constructors with int fields don't fail when
passed a zero value.
|
| |
|
| |
|
|
|
|
|
|
| |
* Cleanup formatting a bit (add spaces).
* Move static var initialized inside init_types() since that's the only place
it's used.
|
|
|
|
| |
param from PEP 328.
|
|
|
|
| |
Reorder compiler_set_lineno() call for consistency.
|
| |
|
|
|
|
|
|
| |
Explicitly clear all elements from arena->a_objects and remove
assert() that refcount is 1. It's possible for a program to get a
reference to the list via sys.getobjects() or via gc functions.
|
|
|
|
|
| |
interpolate PY_FORMAT_SIZE_T instead of #if'ing on
MS_WIN64.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
def foo((x)): was getting recognized as requiring tuple unpacking
which is not correct.
Add tests for this case and the proper way to unpack a tuple of one:
def foo((x,)):
test_inpsect was incorrect before. I'm not sure why it was passing,
but that has been corrected with a test for both functions above.
This means the test (and therefore inspect.getargspec()) are broken in 2.4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
objimpl.h, pymem.h: Stop mapping PyMem_{Del, DEL} and PyMem_{Free, FREE}
to PyObject_{Free, FREE} in a release build. They're aliases for the
system free() now.
_subprocess.c/sp_handle_dealloc(): Since the memory was originally
obtained via PyObject_NEW, it must be released via PyObject_FREE (or
_DEL).
pythonrun.c, tokenizer.c, parsermodule.c: I lost count of the number of
PyObject vs PyMem mismatches in these -- it's like the specific
function called at each site was picked at random, sometimes even with
memory obtained via PyMem getting released via PyObject. Changed most
to use PyObject uniformly, since the blobs allocated are predictably
small in most cases, and obmalloc is generally faster than system
mallocs then.
If extension modules in real life prove as sloppy as Python's front
end, we'll have to revert the objimpl.h + pymem.h part of this patch.
Note that no problems will show up in a debug build (all calls still go
thru obmalloc then). Problems will show up only in a release build, most
likely segfaults.
|
| |
|
|
|
|
|
| |
and later versions because they bumped the default setting to
get our basic tests to run correctly..
|
| |
|
|
|
|
|
| |
Fix crash when a Unicode string containing an encoding declaration is
compile()d. Fixes #1115379.
|
|
|
|
|
|
|
|
| |
This will hopefully get rid of some Coverity warnings, be a hint to
developers, and be marginally faster.
Some asserts were added when the type is currently known, but depends
on values from another function.
|
| |
|
| |
|
|
|
|
| |
(applies patch 1452332)
|
|
|
|
|
|
|
|
| |
PyCodec_IncrementalDecoder().
Factor out common code from PyCodec_Encoder()/PyCodec_Decoder(),
PyCodec_IncrementalEncoder()/PyCodec_IncrementalDecoder() and
PyCodec_StreamReader()/PyCodec_StreamWriter().
|
|
|
|
| |
use macro version of SetItem since we know everything is setup.
|
|
|
|
|
|
|
| |
of tuple) that provides incremental decoders and encoders (a way to use
stateful codecs without the stream API). Functions
codecs.getincrementaldecoder() and codecs.getincrementalencoder() have
been added.
|
|
|
|
| |
continue to be handled correctly
|
|
|
|
|
|
|
| |
Anyway, this is the changes to the with-statement
so that __exit__ must return a true value in order
for a pending exception to be ignored.
The PEP (343) is already updated.
|
|
|
|
|
|
|
| |
python .
python < .
both print a message, return non-zero and do not core dump.
|
|
|
|
|
|
| |
This was mostly written by Travis Oliphant.
I've inspected it all; Neal Norwitz and MvL have also looked at it
(in an earlier incarnation).
|
|
|
|
| |
but an earlier line checked for v != NULL unnecessarily.
|
|
|
|
| |
(reviewed by Neal Norwitz)
|
|
|
|
|
| |
Add (int) casts to silence compiler warnings.
Raise Python exceptions for overflows.
|
| |
|
|
|
|
|
| |
from static analysis. v was already checked for NULL above, so we don't
need a second check.
|
| |
|
|
|
|
| |
I tried to handle Win64 properly, but please review.
|
| |
|
|
|
|
|
| |
One place it wasn't necessary since mod was already checked.
Inline the check that mod != NULL for the other use.
|
|
|
|
| |
Add it back.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|