Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
pyerrors.h134 linesDownload Raw Back to cpython
1#ifndef Py_CPYTHON_ERRORS_H2#  error "this header file must not be included directly"3#endif4 5/* Error objects */6 7/* PyException_HEAD defines the initial segment of every exception class. */8#define PyException_HEAD PyObject_HEAD PyObject *dict;\9             PyObject *args; PyObject *notes; PyObject *traceback;\10             PyObject *context; PyObject *cause;\11             char suppress_context;12 13typedef struct {14    PyException_HEAD15} PyBaseExceptionObject;16 17typedef struct {18    PyException_HEAD19    PyObject *msg;20    PyObject *excs;21    PyObject *excs_str;22} PyBaseExceptionGroupObject;23 24typedef struct {25    PyException_HEAD26    PyObject *msg;27    PyObject *filename;28    PyObject *lineno;29    PyObject *offset;30    PyObject *end_lineno;31    PyObject *end_offset;32    PyObject *text;33    PyObject *print_file_and_line;34    PyObject *metadata;35} PySyntaxErrorObject;36 37typedef struct {38    PyException_HEAD39    PyObject *msg;40    PyObject *name;41    PyObject *path;42    PyObject *name_from;43} PyImportErrorObject;44 45typedef struct {46    PyException_HEAD47    PyObject *encoding;48    PyObject *object;49    Py_ssize_t start;50    Py_ssize_t end;51    PyObject *reason;52} PyUnicodeErrorObject;53 54typedef struct {55    PyException_HEAD56    PyObject *code;57} PySystemExitObject;58 59typedef struct {60    PyException_HEAD61    PyObject *myerrno;62    PyObject *strerror;63    PyObject *filename;64    PyObject *filename2;65#ifdef MS_WINDOWS66    PyObject *winerror;67#endif68    Py_ssize_t written;   /* only for BlockingIOError, -1 otherwise */69} PyOSErrorObject;70 71typedef struct {72    PyException_HEAD73    PyObject *value;74} PyStopIterationObject;75 76typedef struct {77    PyException_HEAD78    PyObject *name;79} PyNameErrorObject;80 81typedef struct {82    PyException_HEAD83    PyObject *obj;84    PyObject *name;85} PyAttributeErrorObject;86 87/* Compatibility typedefs */88typedef PyOSErrorObject PyEnvironmentErrorObject;89#ifdef MS_WINDOWS90typedef PyOSErrorObject PyWindowsErrorObject;91#endif92 93/* Context manipulation (PEP 3134) */94 95PyAPI_FUNC(void) _PyErr_ChainExceptions1(PyObject *);96 97/* In exceptions.c */98 99PyAPI_FUNC(PyObject*) PyUnstable_Exc_PrepReraiseStar(100     PyObject *orig,101     PyObject *excs);102 103/* In signalmodule.c */104 105PyAPI_FUNC(int) PySignal_SetWakeupFd(int fd);106 107/* Support for adding program text to SyntaxErrors */108 109PyAPI_FUNC(void) PyErr_SyntaxLocationObject(110    PyObject *filename,111    int lineno,112    int col_offset);113 114PyAPI_FUNC(void) PyErr_RangedSyntaxLocationObject(115    PyObject *filename,116    int lineno,117    int col_offset,118    int end_lineno,119    int end_col_offset);120 121PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject(122    PyObject *filename,123    int lineno);124 125PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalErrorFunc(126    const char *func,127    const char *message);128 129PyAPI_FUNC(void) PyErr_FormatUnraisable(const char *, ...);130 131PyAPI_DATA(PyObject *) PyExc_PythonFinalizationError;132 133#define Py_FatalError(message) _Py_FatalErrorFunc(__func__, (message))134 
codekingpro/portable-devtools · Team Ai