Skip to content

Commit b6ace75

Browse files
[3.12] pythongh-106989: Remove tok report warnings (pythonGH-106993) (python#107013)
Co-authored-by: Menelaos Kotoglou <[email protected]>
1 parent e7757ab commit b6ace75

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

Parser/tokenizer.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ tok_new(void)
117117
tok->implicit_newline = 0;
118118
tok->tok_mode_stack[0] = (tokenizer_mode){.kind =TOK_REGULAR_MODE, .f_string_quote='\0', .f_string_quote_size = 0, .f_string_debug=0};
119119
tok->tok_mode_stack_index = 0;
120-
tok->tok_report_warnings = 1;
121120
#ifdef Py_DEBUG
122121
tok->debug = _Py_GetConfig()->parser_debug;
123122
#endif
@@ -1546,10 +1545,6 @@ static int
15461545
warn_invalid_escape_sequence(struct tok_state *tok, int first_invalid_escape_char)
15471546
{
15481547

1549-
if (!tok->tok_report_warnings) {
1550-
return 0;
1551-
}
1552-
15531548
PyObject *msg = PyUnicode_FromFormat(
15541549
"invalid escape sequence '\\%c'",
15551550
(char) first_invalid_escape_char

Parser/tokenizer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ struct tok_state {
128128
// TODO: Factor this into its own thing
129129
tokenizer_mode tok_mode_stack[MAXFSTRINGLEVEL];
130130
int tok_mode_stack_index;
131-
int tok_report_warnings;
132131
int tok_extra_tokens;
133132
int comment_newline;
134133
int implicit_newline;

0 commit comments

Comments
 (0)