From d4be68e361f4258cf0848fc70018dfe37a2acc24 Mon Sep 17 00:00:00 2001 From: shadchin Date: Mon, 18 Apr 2022 12:39:32 +0300 Subject: IGNIETFERRO-1816 Update Python 3 from 3.9.12 to 3.10.4 ref:9f96be6d02ee8044fdd6f124b799b270c20ce641 --- .../tools/python3/src/Include/cpython/pyerrors.h | 38 +++++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'contrib/tools/python3/src/Include/cpython/pyerrors.h') diff --git a/contrib/tools/python3/src/Include/cpython/pyerrors.h b/contrib/tools/python3/src/Include/cpython/pyerrors.h index 9c87b539790..3f952456679 100644 --- a/contrib/tools/python3/src/Include/cpython/pyerrors.h +++ b/contrib/tools/python3/src/Include/cpython/pyerrors.h @@ -2,10 +2,6 @@ # error "this header file must not be included directly" #endif -#ifdef __cplusplus -extern "C" { -#endif - /* Error objects */ /* PyException_HEAD defines the initial segment of every exception class. */ @@ -24,6 +20,8 @@ typedef struct { PyObject *filename; PyObject *lineno; PyObject *offset; + PyObject *end_lineno; + PyObject *end_offset; PyObject *text; PyObject *print_file_and_line; } PySyntaxErrorObject; @@ -66,6 +64,17 @@ typedef struct { PyObject *value; } PyStopIterationObject; +typedef struct { + PyException_HEAD + PyObject *name; +} PyNameErrorObject; + +typedef struct { + PyException_HEAD + PyObject *obj; + PyObject *name; +} PyAttributeErrorObject; + /* Compatibility typedefs */ typedef PyOSErrorObject PyEnvironmentErrorObject; #ifdef MS_WINDOWS @@ -82,10 +91,6 @@ PyAPI_FUNC(void) _PyErr_GetExcInfo(PyThreadState *, PyObject **, PyObject **, Py PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *); -/* */ - -#define PyExceptionClass_Name(x) (((PyTypeObject*)(x))->tp_name) - /* Convenience functions */ #ifdef MS_WINDOWS @@ -145,6 +150,13 @@ PyAPI_FUNC(void) PyErr_SyntaxLocationObject( int lineno, int col_offset); +PyAPI_FUNC(void) PyErr_RangedSyntaxLocationObject( + PyObject *filename, + int lineno, + int col_offset, + int end_lineno, + int end_col_offset); + PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject( PyObject *filename, int lineno); @@ -173,6 +185,12 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( Py_ssize_t end, const char *reason /* UTF-8 encoded string */ ); + +PyAPI_FUNC(PyObject *) _PyErr_ProgramDecodedTextObject( + PyObject *filename, + int lineno, + const char* encoding); + PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create( PyObject *object, Py_ssize_t start, @@ -194,7 +212,3 @@ PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalErrorFormat( ...); #define Py_FatalError(message) _Py_FatalErrorFunc(__func__, message) - -#ifdef __cplusplus -} -#endif -- cgit v1.3