Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitac61d58

Browse files
pablogsalencukou
andauthored
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>
1 parent65a12c5 commitac61d58

File tree

11 files changed

+20
-17
lines changed

11 files changed

+20
-17
lines changed

‎Doc/data/stable_abi.dat

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

‎Include/internal/pycore_pyerrors.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ void _PyErr_FormatNote(const char *format, ...);
167167

168168
Py_DEPRECATED(3.12)externvoid_PyErr_ChainExceptions(PyObject*,PyObject*,PyObject*);
169169

170+
// implementation detail for the codeop module.
171+
externPyTypeObject_PyExc_IncompleteInputError;
172+
#definePyExc_IncompleteInputError ((PyObject *)(&_PyExc_IncompleteInputError))
173+
170174
#ifdef__cplusplus
171175
}
172176
#endif

‎Include/pyerrors.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ PyAPI_DATA(PyObject *) PyExc_NotImplementedError;
108108
PyAPI_DATA(PyObject*)PyExc_SyntaxError;
109109
PyAPI_DATA(PyObject*)PyExc_IndentationError;
110110
PyAPI_DATA(PyObject*)PyExc_TabError;
111-
PyAPI_DATA(PyObject*)PyExc_IncompleteInputError;
112111
PyAPI_DATA(PyObject*)PyExc_ReferenceError;
113112
PyAPI_DATA(PyObject*)PyExc_SystemError;
114113
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
returnNone
68-
exceptIncompleteInputErrorase:
68+
except_IncompleteInputErrorase:
6969
returnNone
7070
exceptSyntaxErrorase:
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
ifexcisnotOSErrorandissubclass(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 aboutcustomizing 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: 12 additions & 8 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-
#defineMiddlingExtendsException(EXCBASE,EXCNAME,EXCSTORE,EXCDOC) \
549-
staticPyTypeObject _PyExc_ ## EXCNAME = { \
548+
#defineMiddlingExtendsExceptionEx(EXCBASE,EXCNAME,PYEXCNAME,EXCSTORE,EXCDOC) \
549+
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, \
@@ -557,8 +557,12 @@ static PyTypeObject _PyExc_ ## EXCNAME = { \
557557
(inquiry)EXCSTORE ## _clear, 0, 0, 0, 0, 0, 0, 0, &_ ## EXCBASE, \
558558
0, 0, 0, offsetof(Py ## EXCSTORE ## Object, dict), \
559559
(initproc)EXCSTORE ## _init, 0, 0, \
560-
}; \
561-
PyObject *PyExc_ ## EXCNAME = (PyObject *)&_PyExc_ ## EXCNAME
560+
};
561+
562+
#defineMiddlingExtendsException(EXCBASE,EXCNAME,EXCSTORE,EXCDOC) \
563+
static MiddlingExtendsExceptionEx( \
564+
EXCBASE, EXCNAME, EXCNAME, EXCSTORE, EXCDOC); \
565+
PyObject *PyExc_ ## EXCNAME = (PyObject *)&_PyExc_ ## EXCNAME
562566

563567
#defineComplexExtendsException(EXCBASE,EXCNAME,EXCSTORE,EXCNEW, \
564568
EXCMETHODS,EXCMEMBERS,EXCGETSET, \
@@ -2608,8 +2612,8 @@ MiddlingExtendsException(PyExc_IndentationError, TabError, SyntaxError,
26082612
/*
26092613
* IncompleteInputError extends SyntaxError
26102614
*/
2611-
MiddlingExtendsException(PyExc_SyntaxError,IncompleteInputError,SyntaxError,
2612-
"incomplete input.");
2615+
MiddlingExtendsExceptionEx(PyExc_SyntaxError,IncompleteInputError,_IncompleteInputError,
2616+
SyntaxError,"incomplete input.");
26132617

26142618
/*
26152619
* LookupError extends Exception
@@ -3675,7 +3679,7 @@ static struct static_exception static_exceptions[] = {
36753679

36763680
// Level 4: Other subclasses
36773681
ITEM(IndentationError),// base: SyntaxError(Exception)
3678-
ITEM(IncompleteInputError),// base: SyntaxError(Exception)
3682+
{&_PyExc_IncompleteInputError,"_IncompleteInputError"},// base: SyntaxError(Exception)
36793683
ITEM(IndexError),// base: LookupError(Exception)
36803684
ITEM(KeyError),// base: LookupError(Exception)
36813685
ITEM(ModuleNotFoundError),// base: ImportError(Exception)

‎PC/python3dll.c

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

‎Parser/pegen.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include<Python.h>
22
#include"pycore_ast.h"// _PyAST_Validate(),
33
#include"pycore_pystate.h"// _PyThreadState_GET()
4+
#include"pycore_pyerrors.h"// PyExc_IncompleteInputError
45
#include<errcode.h>
56

67
#include"lexer/lexer.h"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp