summaryrefslogtreecommitdiffstats
path: root/Python/Python-tokenize.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-05-31 10:11:39 (GMT)
committerGitHub <noreply@github.com>2023-05-31 10:11:39 (GMT)
commit2f8c22f1d6c22f018c78264937db66d52fb18869 (patch)
tree0ec6e97374f6c77109a4701820b04294017dabaa /Python/Python-tokenize.c
parent4729100239ce5486fce0ff4d62dad52c30e108c3 (diff)
downloadcpython-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.c2
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]);