| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Calling PyInt_AsLong() on a float truncates it which is almost never
the desired behavior. This closes SF bug #660144.
|
|
|
|
| |
no reason to stall in an endless loop, just call abort() on a fatal error.
|
|
|
|
| |
try to intern them. This has the theoretical problem that resource filenames on sys.path cannot be unicode objects, but in practice that shouldn't matter.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the code slightly shorter, faster, and easier to
read.
* Eliminate unused DUP_TOPX code for x==1.
compile.c always generates DUP_TOP instead.
* Since only two cases remain for DUP_TOPX, replace
the switch-case with if-elseif.
* The in-lined integer compare does a CheckExact on
both arguments. Since the second is a little more
likely to fail, test it first.
* The switch-case for IS/IS_NOT and IN/NOT_IN can
separate the regular and inverted cases with no
additional work. For all four paths, saves a test and
jump.
|
|
|
|
|
|
|
| |
the AEDesc data shouldn't be disposed when the Python object is.
Added a C call AEDesc_NewBorrowed() to create these objects and a Python
method old=AEDesc.AutoDispose(onoff) to change auto-dispose state.
|
| |
|
|
|
|
|
|
| |
The two are semantically equivalent, but the first triggered a compiler
warning about an unused variable. Note, the preceding steps had already
accessed and decreffed the variable so the reference counts were fine.
|
|
|
|
|
|
|
|
| |
parameter being either four or five. Currently, compile.c does not
generate calls with a parameter higher than three.
May have to be reverted if the second alpha or beta shakes out some
other tool generating this op code with a parameter of four or five.
|
|
|
|
|
| |
when a string exception is raised. Note that raising string exceptions
is deprecated in an exception message.
|
|
|
|
|
|
|
|
|
|
|
| |
Replaced groups of pushes and pops with indexed access to the stack and
a single adjustment (if needed) to the stacklevel.
Avoids scores of unnecessary increments and decrements to the stackpointer.
Removes unnecessary sequential dependencies so that the compiler has more
freedom for optimizations. Frees the processor for more parallel and
pipelined execution by using mostly read-only access and having few pointer
adjustments just prior to a read or write.
|
|
|
|
|
|
|
|
| |
This fixes the problem on Windows - that's the only system where I can
test it.
It leaves sys.argv alone and only changes sys.path[0] to an absolute
pathname.
|
|
|
|
| |
Clarify the operation of locals().
|
|
|
|
| |
release branch?)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A variety of changes from Michael Hudson to get the compiler working
with 2.3. The primary change is the handling of SET_LINENO:
# The set_lineno() function and the explicit emit() calls for
# SET_LINENO below are only used to generate the line number table.
# As of Python 2.3, the interpreter does not have a SET_LINENO
# instruction. pyassem treats SET_LINENO opcodes as a special case.
A few other small changes:
- Remove unused code from pycodegen and pyassem.
- Fix error handling in parsermodule. When PyParser_SimplerParseString()
fails, it sets an exception with detailed info. The parsermodule
was clobbering that exception and replacing it was a generic
"could not parse string" exception. Keep the original exception.
|
| |
|
|
|
|
|
|
| |
I can't test this on the snake farm (no aix box is working).
This change works for the submitter seems correct.
Can anybody test this on 32- and 64- bit AIX?
|
|
|
|
|
|
| |
Initialize the small integers and __builtins__ in startup.
This removes some if conditions.
Change XDECREF to DECREF for values which shouldn't be NULL.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- new import hooks in import.c, exposed in the sys module
- new module called 'zipimport'
- various changes to allow bootstrapping from zip files
I hope I didn't break the Windows build (or anything else for that
matter), but then again, it's been sitting on sf long enough...
Regarding the latest discussions on python-dev: zipimport sets
pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as
/path/to/Archive.zip/subdir/ are supported again.
|
|
|
|
| |
Suggested by MvL.
|
|
|
|
|
|
|
| |
Obtain cleaner coding and a system wide
performance boost by using the fast, pre-parsed
PyArg_Unpack function instead of PyArg_ParseTuple
function which is driven by a format string.
|
| |
|
|
|
|
| |
scope and looking at types.
|
| |
|
|
|
|
| |
549213 by Jeremy (checking in for him since he's away and busy).
|
|
|
|
|
| |
The static variable (implicit) was not necessary.
The c_globals can be None or True now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[#448679] Left to right
* Python/compile.c
(com_dictmaker): Reordered evaluation of dictionaries to follow strict
LTR evaluation.
* Lib/compiler/pycodegen.py
(CodeGenerator.visitDict): Reordered evaluation of dictionaries to
follow strict LTR evaluation.
* Doc/ref/ref5.tex
Documented the general LTR evaluation order idea.
* Misc/NEWS
Documented change in evaluation order of dictionaries.
|
|
|
|
| |
extension modules.
|
|
|
|
| |
Py_DECREF
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
supported as the second argument. This has the same meaning as
for isinstance(), i.e. issubclass(X, (A, B)) is equivalent
to issubclass(X, A) or issubclass(X, B). Compared to isinstance(),
this patch does not search the tuple recursively for classes, i.e.
any entry in the tuple that is not a class, will result in a
TypeError.
This closes SF patch #649608.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
in imp". This adds two functions to the imp module: get_frozenmodules()
and set_frozenmodules().
|
| |
|
| |
|
|
|
|
|
| |
the --disable-unicode build doesn't complain about an
unused variable.
|
|
|
|
| |
so the --disable-unicode build doesn't complain about unused variables.
|
|
|
|
|
| |
reported by Michael Hudson in
http://mail.python.org/pipermail/python-dev/2002-November/030299.html
|
|
|
|
|
|
| |
Py_Init crash". refchain cannot be cleared because objects can live across
Py_Finalize() and Py_Initialize() if they are kept alive by circular
references.
|
| |
|
| |
|
|
|
|
|
|
|
| |
[ 631276 ] Exceptions raised by line trace function
It conflicted with the patches from Armin I just checked it, so I had
to so some bits by hand.
|
|
|
|
|
|
|
|
| |
[ 617309 ] getframe hook (Psyco #1)
[ 617311 ] Tiny profiling info (Psyco #2)
[ 617312 ] debugger-controlled jumps (Psyco #3)
These are forward ports from 2.2.2.
|
|
|
|
|
|
|
|
|
|
| |
dialogs are now stored in Mac/Lib, and loaded on demand through macresource.
Not only does this simplify a MacPython based on Apple's Python, but
it also makes Mac error codes come out symbolically when running command
line python (if you have Mac/Lib in your path).
The resource files are copied from Mac/Resources. The old ones will disappear
after the OS9 build procedure has been adjusted.
|