| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
acquiring the import lock around fork() calls. This prevents other threads
from having that lock while the fork happens, and is the recommended way of
dealing with such issues. There are two other locks we care about, the GIL
and the Thread Local Storage lock. The GIL is obviously held when calling
Python functions like os.fork(), and the TLS lock is explicitly reallocated
instead, while also deleting now-orphaned TLS data.
This only fixes calls to os.fork(), not extension modules or embedding
programs calling C's fork() directly. Solving that requires a new set of API
functions, and possibly a rewrite of the Python/thread_*.c mess. Add a
warning explaining the problem to the documentation in the mean time.
This also changes behaviour a little on AIX. Before, AIX (but only AIX) was
getting the import lock reallocated, seemingly to avoid this very same
problem. This is not the right approach, because the import lock is a
re-entrant one, and reallocating would do the wrong thing when forking while
holding the import lock.
Will backport to 2.6, minus the tiny AIX behaviour change.
|
| |
|
|
|
|
| |
on Windows.
|
|
|
|
|
| |
posix zap the execute bit in case it was set on the .py file, since the
compiled files are not directly executable on posix. Patch by Marco N.
|
|
|
|
|
| |
It speeds up the with statement and correctly looks up the special
methods involved.
|
|
|
|
| |
PyImport_AppendInittab() to take a const char *.
|
|
|
|
|
|
|
| |
string was stored beyond the life of the call. Changed the signature to be
const char * to help make this point.
Closes issue #1419652.
|
|
|
|
|
|
| |
POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing
a POP_TOP on each conditional and sometimes allows the peephole optimizer to
skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly.
|
| |
|
|
|
|
|
|
|
| |
an existing .py counterpart, override the co_filename attributes of all
code objects if the original filename is obsolete (which can happen if the
file has been renamed, moved, or if it is accessed through different paths).
Patch by Ziga Seilnacht and Jean-Paul Calderone.
|
| |
|
| |
|
|
|
|
| |
Reviewer: Georg Brandl, Benjamin Peterson
|
|
|
|
| |
has been removed there.
|
|
|
|
| |
when the parent module can't be found during an absolute import (likely due to non-PEP 361 aware code which sets a module level __package__ attribute)
|
|
|
|
|
|
|
| |
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
|
| |
|
| |
|
|
|
|
| |
files on the build bots
|
| |
|
|
|
|
| |
The new PyParser_*Ex() functions are based on Neal's suggestion and initial patch. The new __future__ feature makes all '' and r'' unicode strings. b'' and br'' stay (byte) strings.
|
|
|
|
| |
of in a temp variable (bumps the magic number for pyc files)
|
| |
|
|
|
|
| |
Permission for pyc and pyo files are inherited from the py file.
|
| |
|
| |
|
| |
|
|
|
|
| |
PYTHONDONTWRITEBYTECODE envvar to skip writing bytecode.
|
|
|
|
|
|
| |
imports by calling __import__ with an explicit level of 0
Added a new API function PyImport_ImportModuleNoBlock. It solves the problem with dead locks when mixing threads and imports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New opcode, STORE_MAP saves the compiler from awkward stack manipulations
and specializes for dicts using PyDict_SetItem instead of PyObject_SetItem.
Old disassembly:
0 BUILD_MAP 0
3 DUP_TOP
4 LOAD_CONST 1 (1)
7 ROT_TWO
8 LOAD_CONST 2 ('x')
11 STORE_SUBSCR
12 DUP_TOP
13 LOAD_CONST 3 (2)
16 ROT_TWO
17 LOAD_CONST 4 ('y')
20 STORE_SUBSCR
New disassembly:
0 BUILD_MAP 0
3 LOAD_CONST 1 (1)
6 LOAD_CONST 2 ('x')
9 STORE_MAP
10 LOAD_CONST 3 (2)
13 LOAD_CONST 4 ('y')
16 STORE_MAP
|
| |
|
|
|
|
| |
executable
|
| |
|
| |
|
|
|
|
| |
HAVE_DYNAMIC_LOADING is not defined.
|
| |
|
| |
|
|
|
|
|
| |
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
|
| |
|
|
|
|
| |
typecast to get a 64 bit integer, and undefined the Yield macro that conflicts with winbase.h
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* lines too long
* wrong indentation
* space after a function name
* wrong function name in error string
* simplifying some logic
Also add an error check to PyDict_SetItemString.
|
|
|
|
|
|
| |
Fixed by patch #922167.
Will backport.
|
| |
|
|
|
|
| |
and inline jumps to returns.
|
| |
|
| |
|
|
|
|
|
|
| |
(Also fix some whitespace)
Klocwork #364.
|
|
|
|
| |
imports (if not in package and if beyond toplevel package).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
generator expressions (x for x, in ... ) works again.
Sigh, I only fixed for loops the first time, not list comps and genexprs too.
I couldn't find any more unpacking cases where there is a similar bug lurking.
This code should be refactored to eliminate the duplication. I'm sure
the listcomp/genexpr code can be refactored. I'm not sure if the for loop
can re-use any of the same code though.
Will backport to 2.5 (the only place it matters).
|