[3.12] gh-106989: Remove tok report warnings (GH-106993) (#107013)

Co-authored-by: Menelaos Kotoglou <contact@menelaoskotoglou.com>
This commit is contained in:
Miss Islington (bot) 2023-07-22 06:01:36 -07:00 committed by GitHub
parent e7757ab9e1
commit b6ace7516b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 6 deletions

View file

@ -117,7 +117,6 @@ tok_new(void)
tok->implicit_newline = 0; tok->implicit_newline = 0;
tok->tok_mode_stack[0] = (tokenizer_mode){.kind =TOK_REGULAR_MODE, .f_string_quote='\0', .f_string_quote_size = 0, .f_string_debug=0}; tok->tok_mode_stack[0] = (tokenizer_mode){.kind =TOK_REGULAR_MODE, .f_string_quote='\0', .f_string_quote_size = 0, .f_string_debug=0};
tok->tok_mode_stack_index = 0; tok->tok_mode_stack_index = 0;
tok->tok_report_warnings = 1;
#ifdef Py_DEBUG #ifdef Py_DEBUG
tok->debug = _Py_GetConfig()->parser_debug; tok->debug = _Py_GetConfig()->parser_debug;
#endif #endif
@ -1546,10 +1545,6 @@ static int
warn_invalid_escape_sequence(struct tok_state *tok, int first_invalid_escape_char) warn_invalid_escape_sequence(struct tok_state *tok, int first_invalid_escape_char)
{ {
if (!tok->tok_report_warnings) {
return 0;
}
PyObject *msg = PyUnicode_FromFormat( PyObject *msg = PyUnicode_FromFormat(
"invalid escape sequence '\\%c'", "invalid escape sequence '\\%c'",
(char) first_invalid_escape_char (char) first_invalid_escape_char

View file

@ -128,7 +128,6 @@ struct tok_state {
// TODO: Factor this into its own thing // TODO: Factor this into its own thing
tokenizer_mode tok_mode_stack[MAXFSTRINGLEVEL]; tokenizer_mode tok_mode_stack[MAXFSTRINGLEVEL];
int tok_mode_stack_index; int tok_mode_stack_index;
int tok_report_warnings;
int tok_extra_tokens; int tok_extra_tokens;
int comment_newline; int comment_newline;
int implicit_newline; int implicit_newline;