diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-05-31 10:11:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-31 10:11:39 (GMT) |
commit | 2f8c22f1d6c22f018c78264937db66d52fb18869 (patch) | |
tree | 0ec6e97374f6c77109a4701820b04294017dabaa /Python/Python-tokenize.c | |
parent | 4729100239ce5486fce0ff4d62dad52c30e108c3 (diff) | |
download | cpython-2f8c22f1d6c22f018c78264937db66d52fb18869.zip cpython-2f8c22f1d6c22f018c78264937db66d52fb18869.tar.gz cpython-2f8c22f1d6c22f018c78264937db66d52fb18869.tar.bz2 |
[3.12] gh-105042: Disable unmatched parens syntax error in python tokenize (GH-105061) (#105120)
gh-105042: Disable unmatched parens syntax error in python tokenize (GH-105061)
(cherry picked from commit 70f315c2d6de87b0514ce16cc00a91a5b60a6098)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Diffstat (limited to 'Python/Python-tokenize.c')
-rw-r--r-- | Python/Python-tokenize.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/Python-tokenize.c b/Python/Python-tokenize.c index 4eced66..2de1daa 100644 --- a/Python/Python-tokenize.c +++ b/Python/Python-tokenize.c @@ -82,7 +82,7 @@ _tokenizer_error(struct tok_state *tok) msg = "invalid token"; break; case E_EOF: - if (tok->level) { + if (tok->level > 0) { PyErr_Format(PyExc_SyntaxError, "parenthesis '%c' was never closed", tok->parenstack[tok->level-1]); |