Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-19 09:50:42

0001 #ifndef Py_CPYTHON_ERRORS_H
0002 #  error "this header file must not be included directly"
0003 #endif
0004 
0005 /* Error objects */
0006 
0007 /* PyException_HEAD defines the initial segment of every exception class. */
0008 #define PyException_HEAD PyObject_HEAD PyObject *dict;\
0009              PyObject *args; PyObject *notes; PyObject *traceback;\
0010              PyObject *context; PyObject *cause;\
0011              char suppress_context;
0012 
0013 typedef struct {
0014     PyException_HEAD
0015 } PyBaseExceptionObject;
0016 
0017 typedef struct {
0018     PyException_HEAD
0019     PyObject *msg;
0020     PyObject *excs;
0021 } PyBaseExceptionGroupObject;
0022 
0023 typedef struct {
0024     PyException_HEAD
0025     PyObject *msg;
0026     PyObject *filename;
0027     PyObject *lineno;
0028     PyObject *offset;
0029     PyObject *end_lineno;
0030     PyObject *end_offset;
0031     PyObject *text;
0032     PyObject *print_file_and_line;
0033 } PySyntaxErrorObject;
0034 
0035 typedef struct {
0036     PyException_HEAD
0037     PyObject *msg;
0038     PyObject *name;
0039     PyObject *path;
0040     PyObject *name_from;
0041 } PyImportErrorObject;
0042 
0043 typedef struct {
0044     PyException_HEAD
0045     PyObject *encoding;
0046     PyObject *object;
0047     Py_ssize_t start;
0048     Py_ssize_t end;
0049     PyObject *reason;
0050 } PyUnicodeErrorObject;
0051 
0052 typedef struct {
0053     PyException_HEAD
0054     PyObject *code;
0055 } PySystemExitObject;
0056 
0057 typedef struct {
0058     PyException_HEAD
0059     PyObject *myerrno;
0060     PyObject *strerror;
0061     PyObject *filename;
0062     PyObject *filename2;
0063 #ifdef MS_WINDOWS
0064     PyObject *winerror;
0065 #endif
0066     Py_ssize_t written;   /* only for BlockingIOError, -1 otherwise */
0067 } PyOSErrorObject;
0068 
0069 typedef struct {
0070     PyException_HEAD
0071     PyObject *value;
0072 } PyStopIterationObject;
0073 
0074 typedef struct {
0075     PyException_HEAD
0076     PyObject *name;
0077 } PyNameErrorObject;
0078 
0079 typedef struct {
0080     PyException_HEAD
0081     PyObject *obj;
0082     PyObject *name;
0083 } PyAttributeErrorObject;
0084 
0085 /* Compatibility typedefs */
0086 typedef PyOSErrorObject PyEnvironmentErrorObject;
0087 #ifdef MS_WINDOWS
0088 typedef PyOSErrorObject PyWindowsErrorObject;
0089 #endif
0090 
0091 /* Context manipulation (PEP 3134) */
0092 
0093 PyAPI_FUNC(void) _PyErr_ChainExceptions1(PyObject *);
0094 
0095 /* In exceptions.c */
0096 
0097 PyAPI_FUNC(PyObject*) PyUnstable_Exc_PrepReraiseStar(
0098      PyObject *orig,
0099      PyObject *excs);
0100 
0101 /* In signalmodule.c */
0102 
0103 PyAPI_FUNC(int) PySignal_SetWakeupFd(int fd);
0104 
0105 /* Support for adding program text to SyntaxErrors */
0106 
0107 PyAPI_FUNC(void) PyErr_SyntaxLocationObject(
0108     PyObject *filename,
0109     int lineno,
0110     int col_offset);
0111 
0112 PyAPI_FUNC(void) PyErr_RangedSyntaxLocationObject(
0113     PyObject *filename,
0114     int lineno,
0115     int col_offset,
0116     int end_lineno,
0117     int end_col_offset);
0118 
0119 PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject(
0120     PyObject *filename,
0121     int lineno);
0122 
0123 PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalErrorFunc(
0124     const char *func,
0125     const char *message);
0126 
0127 PyAPI_FUNC(void) PyErr_FormatUnraisable(const char *, ...);
0128 
0129 PyAPI_DATA(PyObject *) PyExc_PythonFinalizationError;
0130 
0131 #define Py_FatalError(message) _Py_FatalErrorFunc(__func__, (message))