File tree Expand file tree Collapse file tree 10 files changed +27
-21
lines changed Expand file tree Collapse file tree 10 files changed +27
-21
lines changed Original file line number Diff line number Diff line change @@ -981,6 +981,11 @@ Removed
981
981
be used instead.
982
982
(Contributed by Serhiy Storchaka in :gh: `86493 `.)
983
983
984
+ * Remove the ``errcode.h `` header file. There was never any public tokenizer C
985
+ API. The ``errcode.h `` header file was only designed to be used by Python
986
+ internals.
987
+ (Contributed by Victor Stinner in :gh: `107162 `.)
988
+
984
989
Pending Removal in Python 3.14
985
990
------------------------------
986
991
Original file line number Diff line number Diff line change 1
- #ifndef Py_ERRCODE_H
2
- #define Py_ERRCODE_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
-
7
-
8
1
/* Error codes passed around between file input, tokenizer, parser and
9
2
interpreter. This is necessary so we can turn them into Python
10
3
exceptions at a higher level. Note that some errors have a
@@ -13,6 +6,16 @@ extern "C" {
13
6
the parser only returns E_EOF when it hits EOF immediately, and it
14
7
never returns E_OK. */
15
8
9
+ #ifndef Py_INTERNAL_ERRCODE_H
10
+ #define Py_INTERNAL_ERRCODE_H
11
+ #ifdef __cplusplus
12
+ extern "C" {
13
+ #endif
14
+
15
+ #ifndef Py_BUILD_CORE
16
+ # error "this header requires Py_BUILD_CORE define"
17
+ #endif
18
+
16
19
#define E_OK 10 /* No error */
17
20
#define E_EOF 11 /* End Of File */
18
21
#define E_INTR 12 /* Interrupted */
@@ -35,4 +38,4 @@ extern "C" {
35
38
#ifdef __cplusplus
36
39
}
37
40
#endif
38
- #endif /* !Py_ERRCODE_H */
41
+ #endif // !Py_INTERNAL_ERRCODE_H
Original file line number Diff line number Diff line change @@ -1625,7 +1625,6 @@ PYTHON_HEADERS= \
1625
1625
$(srcdir)/Include/dictobject.h \
1626
1626
$(srcdir)/Include/dynamic_annotations.h \
1627
1627
$(srcdir)/Include/enumobject.h \
1628
- $(srcdir)/Include/errcode.h \
1629
1628
$(srcdir)/Include/fileobject.h \
1630
1629
$(srcdir)/Include/fileutils.h \
1631
1630
$(srcdir)/Include/floatobject.h \
@@ -1750,10 +1749,11 @@ PYTHON_HEADERS= \
1750
1749
$(srcdir)/Include/internal/pycore_complexobject.h \
1751
1750
$(srcdir)/Include/internal/pycore_condvar.h \
1752
1751
$(srcdir)/Include/internal/pycore_context.h \
1752
+ $(srcdir)/Include/internal/pycore_descrobject.h \
1753
1753
$(srcdir)/Include/internal/pycore_dict.h \
1754
1754
$(srcdir)/Include/internal/pycore_dict_state.h \
1755
- $(srcdir)/Include/internal/pycore_descrobject.h \
1756
1755
$(srcdir)/Include/internal/pycore_dtoa.h \
1756
+ $(srcdir)/Include/internal/pycore_errcode.h \
1757
1757
$(srcdir)/Include/internal/pycore_exceptions.h \
1758
1758
$(srcdir)/Include/internal/pycore_faulthandler.h \
1759
1759
$(srcdir)/Include/internal/pycore_fileutils.h \
Original file line number Diff line number Diff line change 188
188
<ClInclude Include =" ..\Include\dictobject.h" />
189
189
<ClInclude Include =" ..\Include\dynamic_annotations.h" />
190
190
<ClInclude Include =" ..\Include\enumobject.h" />
191
- <ClInclude Include =" ..\Include\errcode.h" />
192
191
<ClInclude Include =" ..\Include\fileobject.h" />
193
192
<ClInclude Include =" ..\Include\fileutils.h" />
194
193
<ClInclude Include =" ..\Include\floatobject.h" />
218
217
<ClInclude Include =" ..\Include\internal\pycore_dict.h" />
219
218
<ClInclude Include =" ..\Include\internal\pycore_dict_state.h" />
220
219
<ClInclude Include =" ..\Include\internal\pycore_dtoa.h" />
220
+ <ClInclude Include =" ..\Include\internal\pycore_errcode.h" />
221
221
<ClInclude Include =" ..\Include\internal\pycore_exceptions.h" />
222
222
<ClInclude Include =" ..\Include\internal\pycore_faulthandler.h" />
223
223
<ClInclude Include =" ..\Include\internal\pycore_fileutils.h" />
Original file line number Diff line number Diff line change 81
81
<ClInclude Include =" ..\Include\enumobject.h" >
82
82
<Filter >Include</Filter >
83
83
</ClInclude >
84
- <ClInclude Include =" ..\Include\errcode.h" >
85
- <Filter >Include</Filter >
86
- </ClInclude >
87
84
<ClInclude Include =" ..\Include\fileobject.h" >
88
85
<Filter >Include</Filter >
89
86
</ClInclude >
558
555
<ClInclude Include =" ..\Include\internal\pycore_dtoa.h" >
559
556
<Filter >Include\internal</Filter >
560
557
</ClInclude >
558
+ <ClInclude Include =" ..\Include\internal\pycore_errcode.h" >
559
+ <Filter >Include\internal</Filter >
560
+ </ClInclude >
561
561
<ClInclude Include =" ..\Include\internal\pycore_exceptions.h" >
562
562
<Filter >Include\internal</Filter >
563
563
</ClInclude >
Original file line number Diff line number Diff line change 1
1
#include <Python.h>
2
2
#include "pycore_ast.h" // _PyAST_Validate(),
3
+ #include "pycore_errcode.h" // E_BADSINGLE
3
4
#include "pycore_pystate.h" // _PyThreadState_GET()
4
- #include <errcode.h>
5
5
6
6
#include "tokenizer.h"
7
7
#include "pegen.h"
Original file line number Diff line number Diff line change 1
1
#include <Python.h>
2
- #include <errcode.h>
3
-
2
+ #include "pycore_errcode.h" // E_TOKEN
4
3
#include "pycore_pyerrors.h" // _PyErr_ProgramDecodedTextObject()
5
4
#include "tokenizer.h"
6
5
#include "pegen.h"
Original file line number Diff line number Diff line change 3
3
4
4
#include "Python.h"
5
5
#include "pycore_call.h" // _PyObject_CallNoArgs()
6
+ #include "pycore_errcode.h" // E_OK
6
7
7
8
#include <ctype.h>
8
9
#include <assert.h>
9
10
10
11
#include "tokenizer.h"
11
- #include "errcode.h"
12
12
13
13
/* Alternate tab spacing */
14
14
#define ALTTABSIZE 1
Original file line number Diff line number Diff line change 1
1
#include "Python.h"
2
- #include "errcode .h"
2
+ #include "pycore_errcode .h" // E_TOKEN
3
3
#include "../Parser/tokenizer.h"
4
4
#include "../Parser/pegen.h" // _PyPegen_byte_offset_to_character_offset()
5
5
#include "../Parser/pegen.h" // _PyPegen_byte_offset_to_character_offset()
Original file line number Diff line number Diff line change 11
11
#include <stdbool.h>
12
12
13
13
#include "Python.h"
14
-
15
14
#include "pycore_ast.h" // PyAST_mod2obj
16
15
#include "pycore_ceval.h" // _Py_EnterRecursiveCall
17
16
#include "pycore_compile.h" // _PyAST_Compile()
17
+ #include "pycore_errcode.h" // E_EOF
18
18
#include "pycore_interp.h" // PyInterpreterState.importlib
19
19
#include "pycore_object.h" // _PyDebug_PrintTotalRefs()
20
20
#include "pycore_parser.h" // _PyParser_ASTFromString()
24
24
#include "pycore_sysmodule.h" // _PySys_Audit()
25
25
#include "pycore_traceback.h" // _PyTraceBack_Print_Indented()
26
26
27
- #include "errcode.h" // E_EOF
28
27
#include "marshal.h" // PyMarshal_ReadLongFromFile()
29
28
30
29
#ifdef MS_WINDOWS
You can’t perform that action at this time.
0 commit comments