Skip to content

Commit edfed4d

Browse files
committed
gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from stable ABI
Signed-off-by: Pablo Galindo <[email protected]>
1 parent b407ad3 commit edfed4d

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

Doc/data/stable_abi.dat

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/pyerrors.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ PyAPI_DATA(PyObject *) PyExc_NotImplementedError;
108108
PyAPI_DATA(PyObject *) PyExc_SyntaxError;
109109
PyAPI_DATA(PyObject *) PyExc_IndentationError;
110110
PyAPI_DATA(PyObject *) PyExc_TabError;
111+
#if !defined(Py_LIMITED_API)
111112
PyAPI_DATA(PyObject *) PyExc_IncompleteInputError;
113+
#endif
112114
PyAPI_DATA(PyObject *) PyExc_ReferenceError;
113115
PyAPI_DATA(PyObject *) PyExc_SystemError;
114116
PyAPI_DATA(PyObject *) PyExc_SystemExit;

Lib/codeop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _maybe_compile(compiler, source, filename, symbol):
6565
try:
6666
compiler(source + "\n", filename, symbol)
6767
return None
68-
except IncompleteInputError as e:
68+
except _IncompleteInputError as e:
6969
return None
7070
except SyntaxError as e:
7171
pass

Lib/test/exception_hierarchy.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ BaseException
4545
├── StopAsyncIteration
4646
├── StopIteration
4747
├── SyntaxError
48-
│ └── IncompleteInputError
48+
│ └── _IncompleteInputError
4949
│ └── IndentationError
5050
│ └── TabError
5151
├── SystemError

Lib/test/test_pickle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ def test_exceptions(self):
569569
EncodingWarning,
570570
BaseExceptionGroup,
571571
ExceptionGroup,
572-
IncompleteInputError):
572+
_IncompleteInputError):
573573
continue
574574
if exc is not OSError and issubclass(exc, OSError):
575575
self.assertEqual(reverse_mapping('builtins', name),

Lib/test/test_stable_abi_ctypes.py

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Misc/stable_abi.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,8 +2480,6 @@
24802480
[function._Py_SetRefcnt]
24812481
added = '3.13'
24822482
abi_only = true
2483-
[data.PyExc_IncompleteInputError]
2484-
added = '3.13'
24852483
[function.PyList_GetItemRef]
24862484
added = '3.13'
24872485
[typedef.PyCFunctionFast]

Objects/exceptions.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,10 @@ static PyTypeObject _PyExc_ ## EXCNAME = { \
545545
}; \
546546
PyObject *PyExc_ ## EXCNAME = (PyObject *)&_PyExc_ ## EXCNAME
547547

548-
#define MiddlingExtendsException(EXCBASE, EXCNAME, EXCSTORE, EXCDOC) \
548+
#define MiddlingExtendsExceptionEx(EXCBASE, EXCNAME, PYEXCNAME, EXCSTORE, EXCDOC) \
549549
static PyTypeObject _PyExc_ ## EXCNAME = { \
550550
PyVarObject_HEAD_INIT(NULL, 0) \
551-
# EXCNAME, \
551+
# PYEXCNAME, \
552552
sizeof(Py ## EXCSTORE ## Object), \
553553
0, (destructor)EXCSTORE ## _dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
554554
0, 0, 0, 0, 0, \
@@ -560,6 +560,9 @@ static PyTypeObject _PyExc_ ## EXCNAME = { \
560560
}; \
561561
PyObject *PyExc_ ## EXCNAME = (PyObject *)&_PyExc_ ## EXCNAME
562562

563+
#define MiddlingExtendsException(EXCBASE, EXCNAME, EXCSTORE, EXCDOC) \
564+
MiddlingExtendsExceptionEx(EXCBASE, EXCNAME, EXCNAME, EXCSTORE, EXCDOC)
565+
563566
#define ComplexExtendsException(EXCBASE, EXCNAME, EXCSTORE, EXCNEW, \
564567
EXCMETHODS, EXCMEMBERS, EXCGETSET, \
565568
EXCSTR, EXCDOC) \
@@ -2608,8 +2611,8 @@ MiddlingExtendsException(PyExc_IndentationError, TabError, SyntaxError,
26082611
/*
26092612
* IncompleteInputError extends SyntaxError
26102613
*/
2611-
MiddlingExtendsException(PyExc_SyntaxError, IncompleteInputError, SyntaxError,
2612-
"incomplete input.");
2614+
MiddlingExtendsExceptionEx(PyExc_SyntaxError, IncompleteInputError, _IncompleteInputError,
2615+
SyntaxError, "incomplete input.");
26132616

26142617
/*
26152618
* LookupError extends Exception
@@ -3675,7 +3678,7 @@ static struct static_exception static_exceptions[] = {
36753678

36763679
// Level 4: Other subclasses
36773680
ITEM(IndentationError), // base: SyntaxError(Exception)
3678-
ITEM(IncompleteInputError), // base: SyntaxError(Exception)
3681+
{&_PyExc_IncompleteInputError, "_IncompleteInputError"}, // base: SyntaxError(Exception)
36793682
ITEM(IndexError), // base: LookupError(Exception)
36803683
ITEM(KeyError), // base: LookupError(Exception)
36813684
ITEM(ModuleNotFoundError), // base: ImportError(Exception)

PC/python3dll.c

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)