Skip to content

Commit

Permalink
gh-126469: remove unnecessary error-checking branch in lexer.c (#12…
Browse files Browse the repository at this point in the history
  • Loading branch information
qqwqqw689 authored Jan 1, 2025
1 parent a327810 commit c810ed7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Parser/lexer/lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c810ed7

Please sign in to comment.