gh-126469: remove unnecessary error-checking branch in lexer.c (#126473)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user