Files
typthon/Include/cpython/pyerrors.h
copilot-swe-agent[bot] 71cf7bf14f Fix more missed Py_ patterns - opcode, thread, exception
Fixed additional patterns:
- _PyOpcode_* → _TyOpcode_* (all opcode metadata)
- _PyUOpName → _TyUOpName
- _PyFunction_* → _TyFunction_*
- _PyListIterObject → _TyListIterObject
- _Py_T_OBJECT → _Ty_T_OBJECT
- Py_BEGIN_ALLOW_THREADS, Py_END_ALLOW_THREADS → Ty_*
- PyDoc_STRVAR, PyDoc_STR → TyDoc_*
- PyInterpreterState, PyThread_*, PyTime_t → Ty*
- PyStructSequence_* → TyStructSequence_*
- PyLockStatus → TyLockStatus
- PyVarObject_HEAD_INIT → TyVarObject_HEAD_INIT
- PyBaseExceptionObject → TyBaseExceptionObject
- Fixed _PyExc_ → _TyExc_ in exception macros

Build is progressing further.

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2025-12-29 18:27:36 +00:00

133 lines
2.9 KiB
C

#ifndef Ty_CPYTHON_ERRORS_H
# error "this header file must not be included directly"
#endif
/* Error objects */
/* PyException_HEAD defines the initial segment of every exception class. */
#define PyException_HEAD PyObject_HEAD TyObject *dict;\
TyObject *args; TyObject *notes; TyObject *traceback;\
TyObject *context; TyObject *cause;\
char suppress_context;
typedef struct {
PyException_HEAD
} TyBaseExceptionObject;
typedef struct {
PyException_HEAD
TyObject *msg;
TyObject *excs;
} PyBaseExceptionGroupObject;
typedef struct {
PyException_HEAD
TyObject *msg;
TyObject *filename;
TyObject *lineno;
TyObject *offset;
TyObject *end_lineno;
TyObject *end_offset;
TyObject *text;
TyObject *print_file_and_line;
TyObject *metadata;
} PySyntaxErrorObject;
typedef struct {
PyException_HEAD
TyObject *msg;
TyObject *name;
TyObject *path;
TyObject *name_from;
} PyImportErrorObject;
typedef struct {
PyException_HEAD
TyObject *encoding;
TyObject *object;
Ty_ssize_t start;
Ty_ssize_t end;
TyObject *reason;
} PyUnicodeErrorObject;
typedef struct {
PyException_HEAD
TyObject *code;
} PySystemExitObject;
typedef struct {
PyException_HEAD
TyObject *myerrno;
TyObject *strerror;
TyObject *filename;
TyObject *filename2;
#ifdef MS_WINDOWS
TyObject *winerror;
#endif
Ty_ssize_t written; /* only for BlockingIOError, -1 otherwise */
} PyOSErrorObject;
typedef struct {
PyException_HEAD
TyObject *value;
} PyStopIterationObject;
typedef struct {
PyException_HEAD
TyObject *name;
} PyNameErrorObject;
typedef struct {
PyException_HEAD
TyObject *obj;
TyObject *name;
} PyAttributeErrorObject;
/* Compatibility typedefs */
typedef PyOSErrorObject PyEnvironmentErrorObject;
#ifdef MS_WINDOWS
typedef PyOSErrorObject PyWindowsErrorObject;
#endif
/* Context manipulation (PEP 3134) */
PyAPI_FUNC(void) _TyErr_ChainExceptions1(TyObject *);
/* In exceptions.c */
PyAPI_FUNC(TyObject*) PyUnstable_Exc_PrepReraiseStar(
TyObject *orig,
TyObject *excs);
/* In signalmodule.c */
PyAPI_FUNC(int) PySignal_SetWakeupFd(int fd);
/* Support for adding program text to SyntaxErrors */
PyAPI_FUNC(void) TyErr_SyntaxLocationObject(
TyObject *filename,
int lineno,
int col_offset);
PyAPI_FUNC(void) TyErr_RangedSyntaxLocationObject(
TyObject *filename,
int lineno,
int col_offset,
int end_lineno,
int end_col_offset);
PyAPI_FUNC(TyObject *) TyErr_ProgramTextObject(
TyObject *filename,
int lineno);
PyAPI_FUNC(void) _Ty_NO_RETURN _Ty_FatalErrorFunc(
const char *func,
const char *message);
PyAPI_FUNC(void) TyErr_FormatUnraisable(const char *, ...);
PyAPI_DATA(TyObject *) TyExc_PythonFinalizationError;
#define Ty_FatalError(message) _Ty_FatalErrorFunc(__func__, (message))