diff options
author | qqwqqw689 <114795525+qqwqqw689@users.noreply.github.com> | 2025-01-01 22:11:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-01 22:11:29 (GMT) |
commit | c810ed7c8e0a7464d19700ba1c8668a406f1c042 (patch) | |
tree | 3a6f307cff09340eb9abeaf67df6edb704520c1b | |
parent | a327810169982e3782bdefc2247789a71aa79b43 (diff) | |
download | cpython-c810ed7c8e0a7464d19700ba1c8668a406f1c042.zip cpython-c810ed7c8e0a7464d19700ba1c8668a406f1c042.tar.gz cpython-c810ed7c8e0a7464d19700ba1c8668a406f1c042.tar.bz2 |
gh-126469: remove unnecessary error-checking branch in `lexer.c` (#126473)
-rw-r--r-- | Parser/lexer/lexer.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Parser/lexer/lexer.c b/Parser/lexer/lexer.c index 8c86859..dbbb94a 100644 --- a/Parser/lexer/lexer.c +++ b/Parser/lexer/lexer.c @@ -329,11 +329,7 @@ verify_identifier(struct tok_state *tok) return 0; } Py_ssize_t invalid = _PyUnicode_ScanIdentifier(s); - if (invalid < 0) { - Py_DECREF(s); - tok->done = E_ERROR; - return 0; - } + assert(invalid >= 0); assert(PyUnicode_GET_LENGTH(s) > 0); if (invalid < PyUnicode_GET_LENGTH(s)) { Py_UCS4 ch = PyUnicode_READ_CHAR(s, invalid); |