diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-11-17 23:18:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 23:18:16 (GMT) |
commit | 0ef308a2890571c850c624fb99ac00f8951363c6 (patch) | |
tree | c3174751e24a1501235090860401965fb9335530 /Parser/pegen/pegen.c | |
parent | 87787c8774221c81602b31b0e0dc0678ad494e91 (diff) | |
download | cpython-0ef308a2890571c850c624fb99ac00f8951363c6.zip cpython-0ef308a2890571c850c624fb99ac00f8951363c6.tar.gz cpython-0ef308a2890571c850c624fb99ac00f8951363c6.tar.bz2 |
bpo-45822: Respect PEP 263's coding cookies in the parser even if flags are not provided (GH-29582) (GH-29585)
(cherry picked from commit da20d7401de97b425897d3069f71f77b039eb16f)
Diffstat (limited to 'Parser/pegen/pegen.c')
-rw-r--r-- | Parser/pegen/pegen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index efcf9ac..2e986c5 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -1225,7 +1225,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); |