| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
pystate.h; pystate.h doesn't use it (I thought I wanted to move the
array there but that won't work).
|
| |
|
|
|
|
|
| |
to protect us from jokers who put items with non-string keys in
sys.modules. Reported by Greg Stein.
|
|
|
|
| |
function name. (Vladimir Kushnir by way of Thomas Gellekum.)
|
|
|
|
| |
(Reported by Jeff Rush.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
initialization of class exceptions. Specifically:
init_class_exc(): This function now returns an integer status of the
class exception initialization. No fatal errors in this method now.
Also, use PySys_WriteStderr() when writing error messages. When an
error occurs in this function, 0 is returned, but the partial creation
of the exception classes is not undone (this happens elsewhere).
Things that could trigger the fallback:
- exceptions.py fails to be imported (due to syntax error, etc.)
- one of the exception classes is missing (e.g. due to library
version mismatch)
- exception class can't be inserted into __builtin__'s dictionary
- MemoryError instance can't be pre-allocated
- some other PyErr_Occurred
newstdexception(): Changed the error message. This is still a fatal
error because if the string based exceptions can't be created, we
really can't continue.
initerrors(): Be sure to xdecref the .exc field, which might be
non-NULL if class exceptions init was aborted.
_PyBuiltin_Init_2(): If class exception init fails, print a warning
message and reinstate the string based exceptions.
|
|
|
|
| |
(Jack Jansen and/or Just van Rossum)
|
|
|
|
|
| |
(which is not a POSIX threads call!). Reported and confirmed by Brad
Howes.
|
|
|
|
| |
Reported by Jonathan Giddy.
|
|
|
|
|
| |
Py_{BEGIN,END}_ALLOW_THREADS macros. Also get rid of the declaration
for it (it's now in pythonrun.h).
|
|
|
|
|
| |
According to Vladimir Marangozov, this is necessary for AIX, where
high optimization levels inline this function and then get it wrong :-(
|
|
|
|
| |
It is needed so that tokenizer.c can use PySys_WriteStderr().
|
|
|
|
|
|
|
| |
that file in fact did not exist or at least was not used. Change this
so that __file__ is *only* set to the .pyc/.pyo file when it actually
read the code object from it; otherwise __file__ is set to the .py
file.
|
|
|
|
|
|
|
|
| |
happen when you use a non-keyword argument after a keyword argument,
and in this case you also get a syntax error. I fully suspect that
the underflow is caused by the code that stops generating code when it
detects the syntax error, but I can't find the culprit right now. I
know, I know.)
|
| |
|
|
|
|
| |
Metrowerks specific #ifdef.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This is a patch that Bill Bummgarner did for 1.4 that hasn't made its
way into the distribution yet. This is important if you want to use
the ObjC module.
|
|
|
|
| |
Win32 in Debug mode).
|
|
|
|
|
|
|
| |
frozen packages. (I *think* this means that we can now have a
built-in module bar that's a submodule of a frozen package foo, by
registering the built-in module with a name "foo.bar" in the table of
builtin modules.)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
However two string literals concatenated are fine!
Hope this doesn't break other platforms.
|
| |
|
| |
|
|
|
|
| |
get rid of redundant error check.
|
|
|
|
|
|
|
|
|
|
|
| |
an exception from errno, with a supplied filename (primarily used by
IOError and OSError). If class exceptions are used then the exception
is instantiated with a 3-tuple: (errno, strerror, filename). For
backwards compatibility reasons, if string exceptions are used,
filename is ignored.
PyErr_SetFromErrno(): Implement in terms of
PyErr_SetFromErrnoWithFilename().
|
|
|
|
|
|
|
|
|
| |
OSError. The EnvironmentError serves primarily as the (common
implementation) base class for IOError and OSError. OSError is used
by posixmodule.c
Also added tuple definition of EnvironmentError when using string
based exceptions.
|
|
|
|
|
|
|
| |
(1) If a sequence S is shorter than len(S) indicated, don't fail --
just use the shorter size. (I.e, len(S) is just a hint.)
(2) Implement the special case map(None, S) as list(S) -- it's faster.
|
| |
|
|
|
|
| |
callable objects than regular Pythonm functions as their im_func.
|
|
|
|
| |
inconsistent.
|
|
|
|
| |
which is now Py_BuildValue().
|
|
|
|
|
|
|
|
|
| |
must be enabled here, otherwise the errno we set on overflows is not
the errno that's being read by compile.c. Wonder how many other files
that do their own "#include config.h" need this too :-(
(Because of the structure of autoconf, it's not so simple to get this
into config.h...)
|
| |
|
|
|
|
| |
exception waiting to happen next...
|
| |
|
|
|
|
|
|
| |
the filename contains at least a rudimentary pathname.
(The bad part is that we need to call getcwd() because only a prefix
of ".\\" is not enough -- we prefix the drive letter.)
|
|
|
|
| |
long, but it sure helps!
|
| |
|
|
|
|
| |
object before using it.
|
| |
|
|
|
|
|
|
| |
and lists; if the size is negative, raise an exception. Also raise an
exception when an undefined type is found -- all this to increase the
chance that garbage input causes an exception instead of a core dump.
|
| |
|
|
|
|
|
|
|
|
| |
swapped arguments].
Also make sure that no use of a function pointer gotten from a
tp_as_sequence or tp_as_mapping structure is made without checking it
for NULL first.
|
|
|
|
|
|
|
|
|
|
|
| |
the code here becomes much simpler. In particular: abs(), divmod(),
pow(), int(), long(), float(), len(), tuple(), list().
Also make sure that no use of a function pointer gotten from a
tp_as_sequence or tp_as_mapping structure is made without checking it
for NULL first.
A few other cosmetic things, such as properly reindenting slice().
|
|
|
|
|
|
|
| |
old value in a temporary and XDECREF it only after then new value has
been set. This prevents the (unlikely) case where the destructor of
the member uses the containing object -- it would find it in an
undefined state.
|
|
|
|
|
|
| |
because the path through the code would notice that sys.__path__ did
not exist and it would fall back to the default path (builtins +
sys.path) instead of failing). No longer.
|