Skip to content

Commit b23a34d

Browse files
committed
gh-153569: fix cross-platform tokenizer builds
1 parent 3c6f06a commit b23a34d

9 files changed

Lines changed: 11 additions & 11 deletions

File tree

Lib/test/test_free_threading/test_tokenize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def next_token(it):
4545
tokenize.TokenInfo(type=1, string='pass', start=(2, 2), end=(2, 6), line=' pass'),
4646
tokenize.TokenInfo(type=4, string='', start=(2, 6), end=(2, 6), line=' pass'),
4747
tokenize.TokenInfo(type=6, string='', start=(2, -1), end=(2, -1), line=' pass'),
48-
tokenize.TokenInfo(type=0, string='', start=(2, -1), end=(2, -1), line=' pass'),
48+
tokenize.TokenInfo(type=0, string='', start=(3, 0), end=(3, 0), line=''),
4949
]
5050

5151
tokens.sort()

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ TOKENIZER_OBJS= \
403403
Parser/tokenizer/reader.o \
404404
Parser/tokenizer/source.o \
405405
Parser/tokenizer/api.o \
406-
Parser/tokenizer/errors.o \
406+
Parser/tokenizer/tokenizer_errors.o \
407407
Parser/tokenizer/helpers.o
408408

409409
PEGEN_HEADERS= \

PCbuild/_freeze_module.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
<ClCompile Include="..\Parser\tokenizer\api.c" />
189189
<ClCompile Include="..\Parser\tokenizer\cursor.c" />
190190
<ClCompile Include="..\Parser\tokenizer\decoder.c" />
191-
<ClCompile Include="..\Parser\tokenizer\errors.c" />
191+
<ClCompile Include="..\Parser\tokenizer\tokenizer_errors.c" />
192192
<ClCompile Include="..\Parser\tokenizer\reader.c" />
193193
<ClCompile Include="..\Parser\tokenizer\source.c" />
194194
<ClCompile Include="..\Parser\tokenizer\helpers.c" />

PCbuild/_freeze_module.vcxproj.filters

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@
481481
<ClCompile Include="..\Parser\tokenizer\decoder.c">
482482
<Filter>Source Files</Filter>
483483
</ClCompile>
484-
<ClCompile Include="..\Parser\tokenizer\errors.c">
484+
<ClCompile Include="..\Parser\tokenizer\tokenizer_errors.c">
485485
<Filter>Source Files</Filter>
486486
</ClCompile>
487487
<ClCompile Include="..\Parser\tokenizer\reader.c">

PCbuild/pythoncore.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@
596596
<ClCompile Include="..\Parser\tokenizer\cursor.c" />
597597
<ClCompile Include="..\Parser\tokenizer\source.c" />
598598
<ClCompile Include="..\Parser\tokenizer\decoder.c" />
599-
<ClCompile Include="..\Parser\tokenizer\errors.c" />
599+
<ClCompile Include="..\Parser\tokenizer\tokenizer_errors.c" />
600600
<ClCompile Include="..\Parser\tokenizer\reader.c" />
601601
<ClCompile Include="..\Parser\tokenizer\helpers.c" />
602602
<ClCompile Include="..\Parser\token.c" />

PCbuild/pythoncore.vcxproj.filters

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@
13701370
<ClCompile Include="..\Parser\tokenizer\decoder.c">
13711371
<Filter>Parser</Filter>
13721372
</ClCompile>
1373-
<ClCompile Include="..\Parser\tokenizer\errors.c">
1373+
<ClCompile Include="..\Parser\tokenizer\tokenizer_errors.c">
13741374
<Filter>Parser</Filter>
13751375
</ClCompile>
13761376
<ClCompile Include="..\Parser\tokenizer\reader.c">

Parser/tokenizer/reader_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ typedef struct {
3737
_PyTok_ChunkOwnership ownership;
3838
} _PyTok_Chunk;
3939

40-
typedef struct _PyTok_Reader {
40+
struct _PyTok_Reader {
4141
_PyTok_ReaderKind kind;
4242
PyObject *readline;
4343
PyObject *decoder;
@@ -63,7 +63,7 @@ typedef struct _PyTok_Reader {
6363
int decoder_finalized;
6464
int exhausted;
6565
int stopped;
66-
} _PyTok_Reader;
66+
};
6767

6868
struct _PyTokenizer;
6969

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ raise_syntax_error_object_at(PyTokenizer *tok, PyObject *type,
229229
PyObject *details;
230230
if (include_end) {
231231
details = Py_BuildValue(
232-
"(OnnNnn)", tok->filename != NULL ? tok->filename : Py_None,
232+
"(OinNin)", tok->filename != NULL ? tok->filename : Py_None,
233233
loc.lineno, col, text, end_loc.lineno, end_col);
234234
}
235235
else {
236236
details = Py_BuildValue(
237-
"(OnnNOO)", tok->filename != NULL ? tok->filename : Py_None,
237+
"(OinNOO)", tok->filename != NULL ? tok->filename : Py_None,
238238
loc.lineno, col, text, Py_None, Py_None);
239239
}
240240
if (details == NULL) {

Tools/peg_generator/pegen/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def compile_c_extension(
133133
str(MOD_DIR.parent.parent.parent / "Parser" / "tokenizer" / "reader.c"),
134134
str(MOD_DIR.parent.parent.parent / "Parser" / "tokenizer" / "source.c"),
135135
str(MOD_DIR.parent.parent.parent / "Parser" / "tokenizer" / "api.c"),
136-
str(MOD_DIR.parent.parent.parent / "Parser" / "tokenizer" / "errors.c"),
136+
str(MOD_DIR.parent.parent.parent / "Parser" / "tokenizer" / "tokenizer_errors.c"),
137137
str(MOD_DIR.parent.parent.parent / "Parser" / "tokenizer" / "helpers.c"),
138138
str(MOD_DIR.parent.parent.parent / "Parser" / "pegen.c"),
139139
str(MOD_DIR.parent.parent.parent / "Parser" / "pegen_errors.c"),

0 commit comments

Comments
 (0)