Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/python3....
File: pyerrors.h
#ifndef Py_ERRORS_H
[0] Fix | Delete
#define Py_ERRORS_H
[1] Fix | Delete
#ifdef __cplusplus
[2] Fix | Delete
extern "C" {
[3] Fix | Delete
#endif
[4] Fix | Delete
[5] Fix | Delete
/* Error objects */
[6] Fix | Delete
[7] Fix | Delete
#ifndef Py_LIMITED_API
[8] Fix | Delete
/* PyException_HEAD defines the initial segment of every exception class. */
[9] Fix | Delete
#define PyException_HEAD PyObject_HEAD PyObject *dict;\
[10] Fix | Delete
PyObject *args; PyObject *traceback;\
[11] Fix | Delete
PyObject *context; PyObject *cause;\
[12] Fix | Delete
char suppress_context;
[13] Fix | Delete
[14] Fix | Delete
typedef struct {
[15] Fix | Delete
PyException_HEAD
[16] Fix | Delete
} PyBaseExceptionObject;
[17] Fix | Delete
[18] Fix | Delete
typedef struct {
[19] Fix | Delete
PyException_HEAD
[20] Fix | Delete
PyObject *msg;
[21] Fix | Delete
PyObject *filename;
[22] Fix | Delete
PyObject *lineno;
[23] Fix | Delete
PyObject *offset;
[24] Fix | Delete
PyObject *text;
[25] Fix | Delete
PyObject *print_file_and_line;
[26] Fix | Delete
} PySyntaxErrorObject;
[27] Fix | Delete
[28] Fix | Delete
typedef struct {
[29] Fix | Delete
PyException_HEAD
[30] Fix | Delete
PyObject *msg;
[31] Fix | Delete
PyObject *name;
[32] Fix | Delete
PyObject *path;
[33] Fix | Delete
} PyImportErrorObject;
[34] Fix | Delete
[35] Fix | Delete
typedef struct {
[36] Fix | Delete
PyException_HEAD
[37] Fix | Delete
PyObject *encoding;
[38] Fix | Delete
PyObject *object;
[39] Fix | Delete
Py_ssize_t start;
[40] Fix | Delete
Py_ssize_t end;
[41] Fix | Delete
PyObject *reason;
[42] Fix | Delete
} PyUnicodeErrorObject;
[43] Fix | Delete
[44] Fix | Delete
typedef struct {
[45] Fix | Delete
PyException_HEAD
[46] Fix | Delete
PyObject *code;
[47] Fix | Delete
} PySystemExitObject;
[48] Fix | Delete
[49] Fix | Delete
typedef struct {
[50] Fix | Delete
PyException_HEAD
[51] Fix | Delete
PyObject *myerrno;
[52] Fix | Delete
PyObject *strerror;
[53] Fix | Delete
PyObject *filename;
[54] Fix | Delete
PyObject *filename2;
[55] Fix | Delete
#ifdef MS_WINDOWS
[56] Fix | Delete
PyObject *winerror;
[57] Fix | Delete
#endif
[58] Fix | Delete
Py_ssize_t written; /* only for BlockingIOError, -1 otherwise */
[59] Fix | Delete
} PyOSErrorObject;
[60] Fix | Delete
[61] Fix | Delete
typedef struct {
[62] Fix | Delete
PyException_HEAD
[63] Fix | Delete
PyObject *value;
[64] Fix | Delete
} PyStopIterationObject;
[65] Fix | Delete
[66] Fix | Delete
/* Compatibility typedefs */
[67] Fix | Delete
typedef PyOSErrorObject PyEnvironmentErrorObject;
[68] Fix | Delete
#ifdef MS_WINDOWS
[69] Fix | Delete
typedef PyOSErrorObject PyWindowsErrorObject;
[70] Fix | Delete
#endif
[71] Fix | Delete
#endif /* !Py_LIMITED_API */
[72] Fix | Delete
[73] Fix | Delete
/* Error handling definitions */
[74] Fix | Delete
[75] Fix | Delete
PyAPI_FUNC(void) PyErr_SetNone(PyObject *);
[76] Fix | Delete
PyAPI_FUNC(void) PyErr_SetObject(PyObject *, PyObject *);
[77] Fix | Delete
#ifndef Py_LIMITED_API
[78] Fix | Delete
PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *);
[79] Fix | Delete
#endif
[80] Fix | Delete
PyAPI_FUNC(void) PyErr_SetString(
[81] Fix | Delete
PyObject *exception,
[82] Fix | Delete
const char *string /* decoded from utf-8 */
[83] Fix | Delete
);
[84] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_Occurred(void);
[85] Fix | Delete
PyAPI_FUNC(void) PyErr_Clear(void);
[86] Fix | Delete
PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
[87] Fix | Delete
PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
[88] Fix | Delete
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
[89] Fix | Delete
PyAPI_FUNC(void) PyErr_GetExcInfo(PyObject **, PyObject **, PyObject **);
[90] Fix | Delete
PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *);
[91] Fix | Delete
#endif
[92] Fix | Delete
[93] Fix | Delete
#if defined(__clang__) || \
[94] Fix | Delete
(defined(__GNUC__) && \
[95] Fix | Delete
((__GNUC__ >= 3) || \
[96] Fix | Delete
(__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))
[97] Fix | Delete
#define _Py_NO_RETURN __attribute__((__noreturn__))
[98] Fix | Delete
#else
[99] Fix | Delete
#define _Py_NO_RETURN
[100] Fix | Delete
#endif
[101] Fix | Delete
[102] Fix | Delete
/* Defined in Python/pylifecycle.c */
[103] Fix | Delete
PyAPI_FUNC(void) Py_FatalError(const char *message) _Py_NO_RETURN;
[104] Fix | Delete
[105] Fix | Delete
#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
[106] Fix | Delete
#define _PyErr_OCCURRED() PyErr_Occurred()
[107] Fix | Delete
#else
[108] Fix | Delete
#define _PyErr_OCCURRED() (PyThreadState_GET()->curexc_type)
[109] Fix | Delete
#endif
[110] Fix | Delete
[111] Fix | Delete
/* Error testing and normalization */
[112] Fix | Delete
PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *);
[113] Fix | Delete
PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *);
[114] Fix | Delete
PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
[115] Fix | Delete
[116] Fix | Delete
/* Traceback manipulation (PEP 3134) */
[117] Fix | Delete
PyAPI_FUNC(int) PyException_SetTraceback(PyObject *, PyObject *);
[118] Fix | Delete
PyAPI_FUNC(PyObject *) PyException_GetTraceback(PyObject *);
[119] Fix | Delete
[120] Fix | Delete
/* Cause manipulation (PEP 3134) */
[121] Fix | Delete
PyAPI_FUNC(PyObject *) PyException_GetCause(PyObject *);
[122] Fix | Delete
PyAPI_FUNC(void) PyException_SetCause(PyObject *, PyObject *);
[123] Fix | Delete
[124] Fix | Delete
/* Context manipulation (PEP 3134) */
[125] Fix | Delete
PyAPI_FUNC(PyObject *) PyException_GetContext(PyObject *);
[126] Fix | Delete
PyAPI_FUNC(void) PyException_SetContext(PyObject *, PyObject *);
[127] Fix | Delete
#ifndef Py_LIMITED_API
[128] Fix | Delete
PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
[129] Fix | Delete
#endif
[130] Fix | Delete
[131] Fix | Delete
/* */
[132] Fix | Delete
[133] Fix | Delete
#define PyExceptionClass_Check(x) \
[134] Fix | Delete
(PyType_Check((x)) && \
[135] Fix | Delete
PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS))
[136] Fix | Delete
[137] Fix | Delete
#define PyExceptionInstance_Check(x) \
[138] Fix | Delete
PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS)
[139] Fix | Delete
[140] Fix | Delete
#define PyExceptionClass_Name(x) \
[141] Fix | Delete
((char *)(((PyTypeObject*)(x))->tp_name))
[142] Fix | Delete
[143] Fix | Delete
#define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
[144] Fix | Delete
[145] Fix | Delete
[146] Fix | Delete
/* Predefined exceptions */
[147] Fix | Delete
[148] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_BaseException;
[149] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_Exception;
[150] Fix | Delete
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
[151] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_StopAsyncIteration;
[152] Fix | Delete
#endif
[153] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_StopIteration;
[154] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_GeneratorExit;
[155] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ArithmeticError;
[156] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_LookupError;
[157] Fix | Delete
[158] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_AssertionError;
[159] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_AttributeError;
[160] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_BufferError;
[161] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_EOFError;
[162] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_FloatingPointError;
[163] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_OSError;
[164] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ImportError;
[165] Fix | Delete
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
[166] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ModuleNotFoundError;
[167] Fix | Delete
#endif
[168] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_IndexError;
[169] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_KeyError;
[170] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_KeyboardInterrupt;
[171] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_MemoryError;
[172] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_NameError;
[173] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_OverflowError;
[174] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_RuntimeError;
[175] Fix | Delete
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
[176] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_RecursionError;
[177] Fix | Delete
#endif
[178] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_NotImplementedError;
[179] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_SyntaxError;
[180] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_IndentationError;
[181] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_TabError;
[182] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ReferenceError;
[183] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_SystemError;
[184] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_SystemExit;
[185] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_TypeError;
[186] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_UnboundLocalError;
[187] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_UnicodeError;
[188] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_UnicodeEncodeError;
[189] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_UnicodeDecodeError;
[190] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_UnicodeTranslateError;
[191] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ValueError;
[192] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ZeroDivisionError;
[193] Fix | Delete
[194] Fix | Delete
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
[195] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_BlockingIOError;
[196] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_BrokenPipeError;
[197] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ChildProcessError;
[198] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ConnectionError;
[199] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ConnectionAbortedError;
[200] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ConnectionRefusedError;
[201] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ConnectionResetError;
[202] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_FileExistsError;
[203] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_FileNotFoundError;
[204] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_InterruptedError;
[205] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_IsADirectoryError;
[206] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_NotADirectoryError;
[207] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_PermissionError;
[208] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ProcessLookupError;
[209] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_TimeoutError;
[210] Fix | Delete
#endif
[211] Fix | Delete
[212] Fix | Delete
[213] Fix | Delete
/* Compatibility aliases */
[214] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_EnvironmentError;
[215] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_IOError;
[216] Fix | Delete
#ifdef MS_WINDOWS
[217] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_WindowsError;
[218] Fix | Delete
#endif
[219] Fix | Delete
[220] Fix | Delete
/* Predefined warning categories */
[221] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_Warning;
[222] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_UserWarning;
[223] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_DeprecationWarning;
[224] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_PendingDeprecationWarning;
[225] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_SyntaxWarning;
[226] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_RuntimeWarning;
[227] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_FutureWarning;
[228] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ImportWarning;
[229] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_UnicodeWarning;
[230] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_BytesWarning;
[231] Fix | Delete
PyAPI_DATA(PyObject *) PyExc_ResourceWarning;
[232] Fix | Delete
[233] Fix | Delete
[234] Fix | Delete
/* Convenience functions */
[235] Fix | Delete
[236] Fix | Delete
PyAPI_FUNC(int) PyErr_BadArgument(void);
[237] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
[238] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
[239] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
[240] Fix | Delete
PyObject *, PyObject *);
[241] Fix | Delete
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03040000
[242] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObjects(
[243] Fix | Delete
PyObject *, PyObject *, PyObject *);
[244] Fix | Delete
#endif
[245] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(
[246] Fix | Delete
PyObject *exc,
[247] Fix | Delete
const char *filename /* decoded from the filesystem encoding */
[248] Fix | Delete
);
[249] Fix | Delete
#if defined(MS_WINDOWS) && !defined(Py_LIMITED_API)
[250] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
[251] Fix | Delete
PyObject *, const Py_UNICODE *);
[252] Fix | Delete
#endif /* MS_WINDOWS */
[253] Fix | Delete
[254] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_Format(
[255] Fix | Delete
PyObject *exception,
[256] Fix | Delete
const char *format, /* ASCII-encoded string */
[257] Fix | Delete
...
[258] Fix | Delete
);
[259] Fix | Delete
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
[260] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_FormatV(
[261] Fix | Delete
PyObject *exception,
[262] Fix | Delete
const char *format,
[263] Fix | Delete
va_list vargs);
[264] Fix | Delete
#endif
[265] Fix | Delete
[266] Fix | Delete
#ifndef Py_LIMITED_API
[267] Fix | Delete
/* Like PyErr_Format(), but saves current exception as __context__ and
[268] Fix | Delete
__cause__.
[269] Fix | Delete
*/
[270] Fix | Delete
PyAPI_FUNC(PyObject *) _PyErr_FormatFromCause(
[271] Fix | Delete
PyObject *exception,
[272] Fix | Delete
const char *format, /* ASCII-encoded string */
[273] Fix | Delete
...
[274] Fix | Delete
);
[275] Fix | Delete
#endif
[276] Fix | Delete
[277] Fix | Delete
#ifdef MS_WINDOWS
[278] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
[279] Fix | Delete
int ierr,
[280] Fix | Delete
const char *filename /* decoded from the filesystem encoding */
[281] Fix | Delete
);
[282] Fix | Delete
#ifndef Py_LIMITED_API
[283] Fix | Delete
/* XXX redeclare to use WSTRING */
[284] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
[285] Fix | Delete
int, const Py_UNICODE *);
[286] Fix | Delete
#endif
[287] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
[288] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
[289] Fix | Delete
PyObject *,int, PyObject *);
[290] Fix | Delete
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03040000
[291] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObjects(
[292] Fix | Delete
PyObject *,int, PyObject *, PyObject *);
[293] Fix | Delete
#endif
[294] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
[295] Fix | Delete
PyObject *exc,
[296] Fix | Delete
int ierr,
[297] Fix | Delete
const char *filename /* decoded from the filesystem encoding */
[298] Fix | Delete
);
[299] Fix | Delete
#ifndef Py_LIMITED_API
[300] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
[301] Fix | Delete
PyObject *,int, const Py_UNICODE *);
[302] Fix | Delete
#endif
[303] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
[304] Fix | Delete
#endif /* MS_WINDOWS */
[305] Fix | Delete
[306] Fix | Delete
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
[307] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetImportErrorSubclass(PyObject *, PyObject *,
[308] Fix | Delete
PyObject *, PyObject *);
[309] Fix | Delete
#endif
[310] Fix | Delete
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
[311] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_SetImportError(PyObject *, PyObject *,
[312] Fix | Delete
PyObject *);
[313] Fix | Delete
#endif
[314] Fix | Delete
[315] Fix | Delete
/* Export the old function so that the existing API remains available: */
[316] Fix | Delete
PyAPI_FUNC(void) PyErr_BadInternalCall(void);
[317] Fix | Delete
PyAPI_FUNC(void) _PyErr_BadInternalCall(const char *filename, int lineno);
[318] Fix | Delete
/* Mask the old API with a call to the new API for code compiled under
[319] Fix | Delete
Python 2.0: */
[320] Fix | Delete
#define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
[321] Fix | Delete
[322] Fix | Delete
/* Function to create a new exception */
[323] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_NewException(
[324] Fix | Delete
const char *name, PyObject *base, PyObject *dict);
[325] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_NewExceptionWithDoc(
[326] Fix | Delete
const char *name, const char *doc, PyObject *base, PyObject *dict);
[327] Fix | Delete
PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *);
[328] Fix | Delete
[329] Fix | Delete
/* In exceptions.c */
[330] Fix | Delete
#ifndef Py_LIMITED_API
[331] Fix | Delete
/* Helper that attempts to replace the current exception with one of the
[332] Fix | Delete
* same type but with a prefix added to the exception text. The resulting
[333] Fix | Delete
* exception description looks like:
[334] Fix | Delete
*
[335] Fix | Delete
* prefix (exc_type: original_exc_str)
[336] Fix | Delete
*
[337] Fix | Delete
* Only some exceptions can be safely replaced. If the function determines
[338] Fix | Delete
* it isn't safe to perform the replacement, it will leave the original
[339] Fix | Delete
* unmodified exception in place.
[340] Fix | Delete
*
[341] Fix | Delete
* Returns a borrowed reference to the new exception (if any), NULL if the
[342] Fix | Delete
* existing exception was left in place.
[343] Fix | Delete
*/
[344] Fix | Delete
PyAPI_FUNC(PyObject *) _PyErr_TrySetFromCause(
[345] Fix | Delete
const char *prefix_format, /* ASCII-encoded string */
[346] Fix | Delete
...
[347] Fix | Delete
);
[348] Fix | Delete
#endif
[349] Fix | Delete
[350] Fix | Delete
[351] Fix | Delete
/* In sigcheck.c or signalmodule.c */
[352] Fix | Delete
PyAPI_FUNC(int) PyErr_CheckSignals(void);
[353] Fix | Delete
PyAPI_FUNC(void) PyErr_SetInterrupt(void);
[354] Fix | Delete
[355] Fix | Delete
/* In signalmodule.c */
[356] Fix | Delete
#ifndef Py_LIMITED_API
[357] Fix | Delete
int PySignal_SetWakeupFd(int fd);
[358] Fix | Delete
#endif
[359] Fix | Delete
[360] Fix | Delete
/* Support for adding program text to SyntaxErrors */
[361] Fix | Delete
PyAPI_FUNC(void) PyErr_SyntaxLocation(
[362] Fix | Delete
const char *filename, /* decoded from the filesystem encoding */
[363] Fix | Delete
int lineno);
[364] Fix | Delete
PyAPI_FUNC(void) PyErr_SyntaxLocationEx(
[365] Fix | Delete
const char *filename, /* decoded from the filesystem encoding */
[366] Fix | Delete
int lineno,
[367] Fix | Delete
int col_offset);
[368] Fix | Delete
#ifndef Py_LIMITED_API
[369] Fix | Delete
PyAPI_FUNC(void) PyErr_SyntaxLocationObject(
[370] Fix | Delete
PyObject *filename,
[371] Fix | Delete
int lineno,
[372] Fix | Delete
int col_offset);
[373] Fix | Delete
#endif
[374] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_ProgramText(
[375] Fix | Delete
const char *filename, /* decoded from the filesystem encoding */
[376] Fix | Delete
int lineno);
[377] Fix | Delete
#ifndef Py_LIMITED_API
[378] Fix | Delete
PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject(
[379] Fix | Delete
PyObject *filename,
[380] Fix | Delete
int lineno);
[381] Fix | Delete
#endif
[382] Fix | Delete
[383] Fix | Delete
/* The following functions are used to create and modify unicode
[384] Fix | Delete
exceptions from C */
[385] Fix | Delete
[386] Fix | Delete
/* create a UnicodeDecodeError object */
[387] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create(
[388] Fix | Delete
const char *encoding, /* UTF-8 encoded string */
[389] Fix | Delete
const char *object,
[390] Fix | Delete
Py_ssize_t length,
[391] Fix | Delete
Py_ssize_t start,
[392] Fix | Delete
Py_ssize_t end,
[393] Fix | Delete
const char *reason /* UTF-8 encoded string */
[394] Fix | Delete
);
[395] Fix | Delete
[396] Fix | Delete
/* create a UnicodeEncodeError object */
[397] Fix | Delete
#ifndef Py_LIMITED_API
[398] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
[399] Fix | Delete
const char *encoding, /* UTF-8 encoded string */
[400] Fix | Delete
const Py_UNICODE *object,
[401] Fix | Delete
Py_ssize_t length,
[402] Fix | Delete
Py_ssize_t start,
[403] Fix | Delete
Py_ssize_t end,
[404] Fix | Delete
const char *reason /* UTF-8 encoded string */
[405] Fix | Delete
);
[406] Fix | Delete
#endif
[407] Fix | Delete
[408] Fix | Delete
/* create a UnicodeTranslateError object */
[409] Fix | Delete
#ifndef Py_LIMITED_API
[410] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
[411] Fix | Delete
const Py_UNICODE *object,
[412] Fix | Delete
Py_ssize_t length,
[413] Fix | Delete
Py_ssize_t start,
[414] Fix | Delete
Py_ssize_t end,
[415] Fix | Delete
const char *reason /* UTF-8 encoded string */
[416] Fix | Delete
);
[417] Fix | Delete
PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create(
[418] Fix | Delete
PyObject *object,
[419] Fix | Delete
Py_ssize_t start,
[420] Fix | Delete
Py_ssize_t end,
[421] Fix | Delete
const char *reason /* UTF-8 encoded string */
[422] Fix | Delete
);
[423] Fix | Delete
#endif
[424] Fix | Delete
[425] Fix | Delete
/* get the encoding attribute */
[426] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *);
[427] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetEncoding(PyObject *);
[428] Fix | Delete
[429] Fix | Delete
/* get the object attribute */
[430] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetObject(PyObject *);
[431] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetObject(PyObject *);
[432] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetObject(PyObject *);
[433] Fix | Delete
[434] Fix | Delete
/* get the value of the start attribute (the int * may not be NULL)
[435] Fix | Delete
return 0 on success, -1 on failure */
[436] Fix | Delete
PyAPI_FUNC(int) PyUnicodeEncodeError_GetStart(PyObject *, Py_ssize_t *);
[437] Fix | Delete
PyAPI_FUNC(int) PyUnicodeDecodeError_GetStart(PyObject *, Py_ssize_t *);
[438] Fix | Delete
PyAPI_FUNC(int) PyUnicodeTranslateError_GetStart(PyObject *, Py_ssize_t *);
[439] Fix | Delete
[440] Fix | Delete
/* assign a new value to the start attribute
[441] Fix | Delete
return 0 on success, -1 on failure */
[442] Fix | Delete
PyAPI_FUNC(int) PyUnicodeEncodeError_SetStart(PyObject *, Py_ssize_t);
[443] Fix | Delete
PyAPI_FUNC(int) PyUnicodeDecodeError_SetStart(PyObject *, Py_ssize_t);
[444] Fix | Delete
PyAPI_FUNC(int) PyUnicodeTranslateError_SetStart(PyObject *, Py_ssize_t);
[445] Fix | Delete
[446] Fix | Delete
/* get the value of the end attribute (the int *may not be NULL)
[447] Fix | Delete
return 0 on success, -1 on failure */
[448] Fix | Delete
PyAPI_FUNC(int) PyUnicodeEncodeError_GetEnd(PyObject *, Py_ssize_t *);
[449] Fix | Delete
PyAPI_FUNC(int) PyUnicodeDecodeError_GetEnd(PyObject *, Py_ssize_t *);
[450] Fix | Delete
PyAPI_FUNC(int) PyUnicodeTranslateError_GetEnd(PyObject *, Py_ssize_t *);
[451] Fix | Delete
[452] Fix | Delete
/* assign a new value to the end attribute
[453] Fix | Delete
return 0 on success, -1 on failure */
[454] Fix | Delete
PyAPI_FUNC(int) PyUnicodeEncodeError_SetEnd(PyObject *, Py_ssize_t);
[455] Fix | Delete
PyAPI_FUNC(int) PyUnicodeDecodeError_SetEnd(PyObject *, Py_ssize_t);
[456] Fix | Delete
PyAPI_FUNC(int) PyUnicodeTranslateError_SetEnd(PyObject *, Py_ssize_t);
[457] Fix | Delete
[458] Fix | Delete
/* get the value of the reason attribute */
[459] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetReason(PyObject *);
[460] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_GetReason(PyObject *);
[461] Fix | Delete
PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_GetReason(PyObject *);
[462] Fix | Delete
[463] Fix | Delete
/* assign a new value to the reason attribute
[464] Fix | Delete
return 0 on success, -1 on failure */
[465] Fix | Delete
PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason(
[466] Fix | Delete
PyObject *exc,
[467] Fix | Delete
const char *reason /* UTF-8 encoded string */
[468] Fix | Delete
);
[469] Fix | Delete
PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason(
[470] Fix | Delete
PyObject *exc,
[471] Fix | Delete
const char *reason /* UTF-8 encoded string */
[472] Fix | Delete
);
[473] Fix | Delete
PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason(
[474] Fix | Delete
PyObject *exc,
[475] Fix | Delete
const char *reason /* UTF-8 encoded string */
[476] Fix | Delete
);
[477] Fix | Delete
[478] Fix | Delete
/* These APIs aren't really part of the error implementation, but
[479] Fix | Delete
often needed to format error messages; the native C lib APIs are
[480] Fix | Delete
not available on all platforms, which is why we provide emulations
[481] Fix | Delete
for those platforms in Python/mysnprintf.c,
[482] Fix | Delete
WARNING: The return value of snprintf varies across platforms; do
[483] Fix | Delete
not rely on any particular behavior; eventually the C99 defn may
[484] Fix | Delete
be reliable.
[485] Fix | Delete
*/
[486] Fix | Delete
#if defined(MS_WIN32) && !defined(HAVE_SNPRINTF)
[487] Fix | Delete
# define HAVE_SNPRINTF
[488] Fix | Delete
# define snprintf _snprintf
[489] Fix | Delete
# define vsnprintf _vsnprintf
[490] Fix | Delete
#endif
[491] Fix | Delete
[492] Fix | Delete
#include <stdarg.h>
[493] Fix | Delete
PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...)
[494] Fix | Delete
Py_GCC_ATTRIBUTE((format(printf, 3, 4)));
[495] Fix | Delete
PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_list va)
[496] Fix | Delete
Py_GCC_ATTRIBUTE((format(printf, 3, 0)));
[497] Fix | Delete
[498] Fix | Delete
#ifdef __cplusplus
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function