| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The next step of PEP 352 (for 2.6) causes raising a string exception to trigger
a TypeError. Trying to catch a string exception raises a DeprecationWarning.
References to string exceptions has been removed from the docs since they are
now just an error.
|
|
|
|
| |
the PREDICT macros.
|
|
|
|
| |
instead of just a dictionary. (backporting...)
|
|
|
|
|
|
|
| |
sys.callstats() match its docstring.
Backport candidate. Though it's an API change, this is a pretty obscure
portion of the API.
|
|
|
|
|
|
| |
Verify that PyEval_Get{Globals,Locals} returned valid pointers.
Klocwork 231-232
|
|
|
|
|
|
|
| |
I modified this patch some by fixing style, some error checking, and adding
XXX comments. This patch requires review and some changes are to be expected.
I'm checking in now to get the greatest possible review and establish a
baseline for moving forward. I don't want this to hold up release if possible.
|
|
|
|
| |
were not supposed to go it. Only Modules/_ctypes/cfields.c was supposed to be changed
|
|
|
|
| |
Klocwork #233
|
| |
|
| |
|
|
|
|
| |
at the NeedForSpeed sprint.
|
|
|
|
|
|
| |
- update header checks, using autoconf
- provide dummies for getenv, environ, and GetVersion
- adjust MSC_VER check in socketmodule.c
|
|
|
|
| |
[ 1456209 ] dictresize() vulnerability ( <- backport candidate ).
|
|
|
|
|
| |
lining killed performance on certain Intel boxes, and the "aggressive"
macro itself gives most of the benefits on others.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
but Trent's copy thinks that it's an anachronism...
|
|
|
|
| |
LOCAL inlining; also added some missing whitespace
|
|
|
|
|
| |
for SRE and others. applied Py_LOCAL to relevant portion of ceval,
which gives a 1-2% speedup on my machine. ymmv.
|
|
|
|
| |
with PyObject_CallFunctionObjArgs, which is 30% faster.
|
| |
|
|
|
|
| |
if a continue inside a try failed.
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
was having funny effects when called on >2Gb strings ;P
|
| |
|
|
|
|
| |
in Python/Python-ast.c. Not sure what to do about those.
|
|
|
|
|
|
|
|
| |
that are suspended outside of any try/except/finally blocks to be
garbage collected even if they are part of a cycle. Generators that
suspend inside of an active try/except or try/finally block (including
those created by a ``with`` statement) are still not GC-able if they
are part of a cycle, however.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
(reviewed by Neal Norwitz)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
added message attribute compared to the previous version of Exception. It is
also a new-style class, making all exceptions now new-style. KeyboardInterrupt
and SystemExit inherit from BaseException directly. String exceptions now
raise DeprecationWarning.
Applies patch 1104669, and closes bugs 1012952 and 518846.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- New semantics for __exit__() -- it must re-raise the exception
if type is not None; the with-statement itself doesn't do this.
(See the updated PEP for motivation.)
- Added context managers to:
- file
- thread.LockType
- threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore}
- decimal.Context
- Added contextlib.py, which defines @contextmanager, nested(), closing().
- Unit tests all around; bot no docs yet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- IMPORT_NAME takes an extra argument from the stack: the relativeness of
the import. Only passed to __import__ when it's not -1.
- __import__() takes an optional 5th argument for the same thing; it
__defaults to -1 (old semantics: try relative, then absolute)
- 'from . import name' imports name (be it module or regular attribute)
from the current module's *package*. Likewise, 'from .module import name'
will import name from a sibling to the current module.
- Importing from outside a package is not allowed; 'from . import sys' in a
toplevel module will not work, nor will 'from .. import sys' in a
(single-level) package.
- 'from __future__ import absolute_import' will turn on the new semantics
for import and from-import: imports will be absolute, except for
from-import with dots.
Includes tests for regular imports and importhooks, parser changes and a
NEWS item, but no compiler-package changes or documentation changes.
|
|
|
|
|
| |
exceptions. This was triggered when 'warnings' had a filter set to "error"
that caught the string exception deprecation warning.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was started by Mike Bland and completed by Guido
(with help from Neal).
This still needs a __future__ statement added;
Thomas is working on Michael's patch for that aspect.
There's a small amount of code cleanup and refactoring
in ast.c, compile.c and ceval.c (I fixed the lltrace
behavior when EXT_POP is used -- however I had to make
lltrace a static global).
|
| |
|
| |
|
| |
|
|
|
|
|
| |
call_function(), rather than commenting on the lack of an explanation in a
comment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In C++, it's an error to pass a string literal to a char* function
without a const_cast(). Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.
I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc. Predictably, there were a large set of functions that
needed to be fixed as a result of these changes. The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].
One cast was required as a result of the changes: A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.
The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests.
|
|
|
|
| |
with an exception currently set!
|
|
|
|
| |
hotshot.stats.load.
|
|
|
|
|
| |
method still needs to support string exceptions, and allow None for the
third argument. Documentation updates are needed, too.
|
| |
|