mirror of
https://github.com/python/cpython.git
synced 2025-11-05 12:34:24 +00:00
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.
|
||
|---|---|---|
| .. | ||
| atof.c | ||
| bltinmodule.c | ||
| ceval.c | ||
| compile.c | ||
| dup2.c | ||
| errors.c | ||
| fmod.c | ||
| frozen.c | ||
| frozenmain.c | ||
| getargs.c | ||
| getcompiler.c | ||
| getcopyright.c | ||
| getcwd.c | ||
| getmtime.c | ||
| getopt.c | ||
| getplatform.c | ||
| getversion.c | ||
| graminit.c | ||
| hypot.c | ||
| import.c | ||
| importdl.c | ||
| importdl.h | ||
| Makefile.in | ||
| marshal.c | ||
| memmove.c | ||
| modsupport.c | ||
| mystrtoul.c | ||
| pyfpe.c | ||
| pystate.c | ||
| pythonmain.c | ||
| pythonrun.c | ||
| sigcheck.c | ||
| strdup.c | ||
| strerror.c | ||
| strtod.c | ||
| structmember.c | ||
| sysmodule.c | ||
| thread.c | ||
| thread_cthread.h | ||
| thread_foobar.h | ||
| thread_lwp.h | ||
| thread_nt.h | ||
| thread_os2.h | ||
| thread_pthread.h | ||
| thread_sgi.h | ||
| thread_solaris.h | ||
| traceback.c | ||