diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-11-16 20:30:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 20:30:47 (GMT) |
commit | da20d7401de97b425897d3069f71f77b039eb16f (patch) | |
tree | 33c3455515ed48151cb2521bbfa41e3d0277e090 /Parser/pegen.c | |
parent | d7e210070f915d8df5fa863ecba8628304ee1ded (diff) | |
download | cpython-da20d7401de97b425897d3069f71f77b039eb16f.zip cpython-da20d7401de97b425897d3069f71f77b039eb16f.tar.gz cpython-da20d7401de97b425897d3069f71f77b039eb16f.tar.bz2 |
bpo-45822: Respect PEP 263's coding cookies in the parser even if flags are not provided (GH-29582)
Diffstat (limited to 'Parser/pegen.c')
-rw-r--r-- | Parser/pegen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c index 2931a40..15879a6 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -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); |