| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
PyErr_GivenExceptionMatches().
set_exc_info(): make sure to normalize exceptions.
do_raise(): Use PyErr_NormalizeException() if type is a class.
loop_subscript(): Use PyErr_ExceptionMatches() instead of raw pointer
compare for PyExc_IndexError.
|
|
|
|
| |
class wins. Makes more sense.
|
|
|
|
| |
'Py_Cleanup' back to 'cleanup'.
|
|
|
|
|
|
|
| |
Everything should now work again.
See the comments for the .h files mass checkin (e.g. pystate.h) for
more detail.
|
|
|
|
|
| |
class has a __class__ attribute, call that to create the new class.
This allows us to write metaclasses purely in C!
|
|
|
|
|
|
| |
WITH_THREAD as PyEval_InitThreads().
Removed use of Py_SuppressPrintingFlag.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyThreadState pointer instead of a (frame) PyObject pointer. This
makes much more sense. It is backward incompatible, but that's no
problem, because (a) the heaviest users are the Py_{BEGIN,END}_
ALLOW_THREADS macros here, which have been fixed too; (b) there are
very few direct users; (c) those who use it are there will probably
appreciate the change.
Also, added new functions PyEval_AcquireThread() and
PyEval_ReleaseThread() which allows the threads created by the thread
module as well threads created by others (!) to set/reset the current
thread, and at the same time acquire/release the interpreter lock.
Much saner.
|
|
|
|
|
|
|
| |
int+int, int-int, int <compareop> int, and list[int].
(Unfortunately, int*int is way too much code to inline.)
Also corrected a NULL that should have been a zero.
|
| |
|
|
|
|
| |
instead of calling PyErr_Clear(). Add checking of those errors.
|
|
|
|
|
| |
Also delay DECREF calls until after the structures have been updated
(for reentrancy awareness).
|
| |
|
| |
|
|
|
|
| |
symbols is needed, define these in Python.h with a Py_ prefix.
|
|
|
|
|
|
| |
get/set/del item). This removes a pile of duplication. There's no
abstract operator for 'not' but I removed the function call for it
anyway -- it's a little faster in-line.
|
|
|
|
|
| |
All per-thread globals are moved into a struct which is manipulated
separately.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
by the frameobject dealloc when it is time for the locals to go. When
there's still a traceback object referencing this stack frame, we
don't want the local variables to disappear yet.
(Hmm... Shouldn't they be copied to the f_locals dictionary?)
|
|
|
|
|
|
|
|
|
| |
- Use co->... instead of f->f_code->...; save an extra lookup of what
we already have in a local variable).
- Remove test for nlocals > 0 before setting fastlocals to
f->f_localsplus; 0 is a rare case and the assignment is safe even
then.
|
|
|
|
|
|
|
| |
called with keyword arguments -- the keyword and value were leaked.
This affected for instance with a __call__() method.
Bug reported and fix supplied by Jim Fulton.
|
|
|
|
|
|
| |
i.e., counting opcode frequencies, or (with DXPAIRS defined) opcode
pair frequencies. Define DYNAMIC_EXECUTION_PROFILE on the command
line (for this file and for sysmodule.c) to enable.
|
|
|
|
|
| |
jump to the "Kill locals" section at the end. Add #ifdef macintosh
bandaid to make sure we call sigcheck() on the Mac.
|
|
|
|
|
| |
leak of memory and file descriptors (thanks for Roj for reporting
that!). Alas, the speed goes down by 5%. :-(
|
|
|
|
|
|
|
| |
This is safe now that both intrcheck() and signalmodule.c schedule a
sigcheck() call via Py_AddPendingCall().
This gives another 7% speedup (never run such a test twice ;-).
|
|
|
|
|
|
|
|
|
|
| |
- fix bug in Py_MakePendingCalls() with threading
- fix return type of do_raise
- remove build_slice (same as PySlice_New)
- remove code inside #if 0
- remove code inside #ifdef CHECK_STACK
- remove code inside #ifdef SUPPORT_OBSOLETE_ACCESS
- comment about newimp.py should refer to ni.py
|
|
|
|
|
|
| |
- get fastlocals differently
- call newframeobject() with fewer arguments
- toss getowner(), which was unused anyway
|
|
|
|
|
| |
break to most cases, as suggested by Tim Peters. This gives another
8-10% speedup.
|
|
|
|
| |
from compile.h. Remove all eval stack overflow checks.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The raise logic has one additional feature: if you raise <class>,
<value> where <value> is not an instance, it will construct an
instance using <value> as argument. If <value> is None, <class> is
instantiated without arguments. If <value> is a tuple, it is used as
the argument list.
This feature is intended to make it easier to upgrade code from using
string exceptions to using class exceptions; without this feature,
you'd have to change every raise statement from ``raise X'' to ``raise
X()'' and from ``raise X, y'' to ``raise X(y)''. The latter is still
the recommended form (because it has no ambiguities about the number
of arguments), but this change makes the transition less painful.
|
|
|
|
|
|
| |
base class is special it gets invoked.
Make gcc -Wall happy.
|
| |
|
| |
|
|
|
|
| |
floatobject.c.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Changed #ifdef DEBUG slightly.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
f(kw=value) is seen as f('kw', value))
|
| |
|