| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
messages for specific changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a new builtin exception, UnboundLocalError, raised when ceval.c
tries to retrieve or delete a local name that isn't bound to a value.
Currently raises NameError, which makes this behavior a FAQ since the same
error is raised for "missing" global names too: when the user has a global
of the same name as the unbound local, NameError makes no sense to them.
Even in the absence of shadowing, knowing whether a bogus name is local or
global is a real aid to quick understanding.
Example:
D:\src\PCbuild>type local.py
x = 42
def f():
print x
x = 13
return x
f()
D:\src\PCbuild>python local.py
Traceback (innermost last):
File "local.py", line 8, in ?
f()
File "local.py", line 4, in f
print x
UnboundLocalError: x
D:\src\PCbuild>
Note that UnboundLocalError is a subclass of NameError, for compatibility
with existing class-exception code that may be trying to catch this as a
NameError. Unfortunately, I see no way to make this wholly compatible
with -X (see comments in bltinmodule.c): under -X, [UnboundLocalError
is an alias for NameError --GvR].
[The ceval.c patch differs slightly from the second version that Tim
submitted; I decided not to raise UnboundLocalError for DELETE_NAME,
only for DELETE_LOCAL. DELETE_NAME is only generated at the module
level, and since at that level a NameError is raised for referencing
an undefined name, it should also be raised for deleting one.]
|
|
|
|
|
|
| |
indicate to those that are using the CVS access that they are using a
newer-than-1.2.5 version, without committing to a particular version
number or patch level.
|
| |
|
| |
|
|
|
|
| |
Add '+' to string version number to indicate we're beyond b2 now.
|
| |
|
|
|
|
| |
As requested by Bill Janssen.
|
| |
|
| |
|
|
|
|
|
|
| |
PycStringIO_IMPORT. While arguably the name used in the documentation
is more consistent, I think it's probably safer not to change the
macro definition and instead fix the doco.
|
| |
|
|
|
|
| |
Donn Cave tells me the PyImport_BeImageID() function isn't needed anymore.
|
|
|
|
|
| |
The version numbers are now exported by Python.h.
Also rolled back the API version change -- it's back to 1007!
|
|
|
|
|
| |
As Chris H. points out, I should have added 'extern' to the
declaration of _PyThreadState_Current. Here it is.
|
|
|
|
|
| |
names in the source code (they already had those for the linker,
through some smart macros; but the source still had the old, un-Py names).
|
|
|
|
| |
_PyThreadState_Current, defined in pystate.c.
|
| |
|
|
|
|
| |
function as DL_IMPORT()!
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
next week. :-)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new member to the PyBufferProcs struct, bf_getcharbuffer. For
backward compatibility, this member should only be used (this includes
testing for NULL!) when the flag Py_TPFLAGS_HAVE_GETCHARBUFFER is set
in the type structure, below. Note that if its flag is not set, we
may be looking at an extension module compiled for 1.5.1, which will
have garbage at the bf_getcharbuffer member (because the struct wasn't
as long then). If the flag is one, the pointer may still be NULL.
The function found at this member is used in a similar manner as
bf_getreadbuffer, but it is known to point to 8-bit character data.
(See discussion in getargs.c checked in later.)
As a general feature for extending the type structure and the various
structures that (may) hang off it in a backwards compatible way, we
rename the tp_xxx4 "spare" slot to tp_flags. In 1.5.1 and before,
this slot was always zero. In 1.5.1, it may contain various flags
indicating extra fields that weren't present in 1.5.1. The only flag
defined so far is for the bf_getcharbuffer member of the PyBufferProcs
struct.
Note that the new spares (tp_xxx5 - tp_xxx8), once they become used,
should also be protected by a flag (or flags) in tp_flags.
|
|
|
|
|
| |
as the code string of code objects, as long as they support
the (readonly) buffer interface. By Greg Stein.
|
| |
|
|
|
|
| |
expecting some contributions).
|
| |
|
|
|
|
|
| |
here; pystate.h doesn't use it (I thought I wanted to move the array
there but that won't work).
|
|
|
|
| |
as this is the logical order of dependencies. Suggested by Jeff Rush.
|
|
|
|
|
| |
native format, as void* (translated to Python int or long).
Also adds PyLong_FromVoidPtr and PyLong_AsVoidPtr to longobject.c.
|
|
|
|
| |
compiler doesn't grumble. Greg Stein's suggestion.
|
|
|
|
|
|
| |
The MS compiler doesn't call it 'long long', it uses __int64,
so a new #define, LONG_LONG, has been added and all occurrences
of 'long long' are replaced with it.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
New function: PyErr_SetFromErrnoWithFilename(PyObject* char*)
|
| |
|
|
|
|
| |
macros for more efficient access to the fields.
|
|
|
|
| |
to the .h file and add macros there for inlined access to the fields.
|
| |
|
| |
|
|
|
|
| |
Py_InitModule4() with appropriate arguments.
|
|
|
|
| |
we are threading, otherwise accessing errno doesn't work right.
|
| |
|
|
|
|
|
| |
PySys_WriteStdout(format, ...)
PySys_WriteStderr(format, ...)
|
|
|
|
|
| |
#define.
(Jack)
|
| |
|