mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-45822: Respect PEP 263's coding cookies in the parser even if flags are not provided (GH-29582)
This commit is contained in:
parent
d7e210070f
commit
da20d7401d
4 changed files with 25 additions and 1 deletions
|
@ -1463,7 +1463,7 @@ _PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filen
|
|||
int exec_input = start_rule == Py_file_input;
|
||||
|
||||
struct tok_state *tok;
|
||||
if (flags == NULL || flags->cf_flags & PyCF_IGNORE_COOKIE) {
|
||||
if (flags != NULL && flags->cf_flags & PyCF_IGNORE_COOKIE) {
|
||||
tok = _PyTokenizer_FromUTF8(str, exec_input);
|
||||
} else {
|
||||
tok = _PyTokenizer_FromString(str, exec_input);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue