summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorqqwqqw689 <114795525+qqwqqw689@users.noreply.github.com>2025-01-01 22:11:29 (GMT)
committerGitHub <noreply@github.com>2025-01-01 22:11:29 (GMT)
commitc810ed7c8e0a7464d19700ba1c8668a406f1c042 (patch)
tree3a6f307cff09340eb9abeaf67df6edb704520c1b /Parser
parenta327810169982e3782bdefc2247789a71aa79b43 (diff)
downloadcpython-c810ed7c8e0a7464d19700ba1c8668a406f1c042.zip
cpython-c810ed7c8e0a7464d19700ba1c8668a406f1c042.tar.gz
cpython-c810ed7c8e0a7464d19700ba1c8668a406f1c042.tar.bz2
gh-126469: remove unnecessary error-checking branch in `lexer.c` (#126473)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/lexer/lexer.c6
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);