summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2024-06-24 12:08:12 (GMT)
committerGitHub <noreply@github.com>2024-06-24 12:08:12 (GMT)
commitac61d58db0753a3b37de21dbc6e86b38f2a93f1b (patch)
tree72db14d0ec67eddbf47f8bed8bfd59c9e3ed586d /Objects
parent65a12c559cbc13c2c5a4aa65c76310bd8d2051a7 (diff)
downloadcpython-ac61d58db0753a3b37de21dbc6e86b38f2a93f1b.zip
cpython-ac61d58db0753a3b37de21dbc6e86b38f2a93f1b.tar.gz
cpython-ac61d58db0753a3b37de21dbc6e86b38f2a93f1b.tar.bz2
gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
Diffstat (limited to 'Objects')
-rw-r--r--Objects/exceptions.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 3a72cce..6376f2f 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -545,10 +545,10 @@ static PyTypeObject _PyExc_ ## EXCNAME = { \
}; \
PyObject *PyExc_ ## EXCNAME = (PyObject *)&_PyExc_ ## EXCNAME
-#define MiddlingExtendsException(EXCBASE, EXCNAME, EXCSTORE, EXCDOC) \
-static PyTypeObject _PyExc_ ## EXCNAME = { \
+#define MiddlingExtendsExceptionEx(EXCBASE, EXCNAME, PYEXCNAME, EXCSTORE, EXCDOC) \
+PyTypeObject _PyExc_ ## EXCNAME = { \
PyVarObject_HEAD_INIT(NULL, 0) \
- # EXCNAME, \
+ # PYEXCNAME, \
sizeof(Py ## EXCSTORE ## Object), \
0, (destructor)EXCSTORE ## _dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, \
@@ -557,8 +557,12 @@ static PyTypeObject _PyExc_ ## EXCNAME = { \
(inquiry)EXCSTORE ## _clear, 0, 0, 0, 0, 0, 0, 0, &_ ## EXCBASE, \
0, 0, 0, offsetof(Py ## EXCSTORE ## Object, dict), \
(initproc)EXCSTORE ## _init, 0, 0, \
-}; \
-PyObject *PyExc_ ## EXCNAME = (PyObject *)&_PyExc_ ## EXCNAME
+};
+
+#define MiddlingExtendsException(EXCBASE, EXCNAME, EXCSTORE, EXCDOC) \
+ static MiddlingExtendsExceptionEx( \
+ EXCBASE, EXCNAME, EXCNAME, EXCSTORE, EXCDOC); \
+ PyObject *PyExc_ ## EXCNAME = (PyObject *)&_PyExc_ ## EXCNAME
#define ComplexExtendsException(EXCBASE, EXCNAME, EXCSTORE, EXCNEW, \
EXCMETHODS, EXCMEMBERS, EXCGETSET, \
@@ -2608,8 +2612,8 @@ MiddlingExtendsException(PyExc_IndentationError, TabError, SyntaxError,
/*
* IncompleteInputError extends SyntaxError
*/
-MiddlingExtendsException(PyExc_SyntaxError, IncompleteInputError, SyntaxError,
- "incomplete input.");
+MiddlingExtendsExceptionEx(PyExc_SyntaxError, IncompleteInputError, _IncompleteInputError,
+ SyntaxError, "incomplete input.");
/*
* LookupError extends Exception
@@ -3675,7 +3679,7 @@ static struct static_exception static_exceptions[] = {
// Level 4: Other subclasses
ITEM(IndentationError), // base: SyntaxError(Exception)
- ITEM(IncompleteInputError), // base: SyntaxError(Exception)
+ {&_PyExc_IncompleteInputError, "_IncompleteInputError"}, // base: SyntaxError(Exception)
ITEM(IndexError), // base: LookupError(Exception)
ITEM(KeyError), // base: LookupError(Exception)
ITEM(ModuleNotFoundError), // base: ImportError(Exception)