Skip to content

Commit c810ed7

Browse files
authored
gh-126469: remove unnecessary error-checking branch in lexer.c (#126473)
1 parent a327810 commit c810ed7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Parser/lexer/lexer.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,7 @@ verify_identifier(struct tok_state *tok)
329329
return 0;
330330
}
331331
Py_ssize_t invalid = _PyUnicode_ScanIdentifier(s);
332-
if (invalid < 0) {
333-
Py_DECREF(s);
334-
tok->done = E_ERROR;
335-
return 0;
336-
}
332+
assert(invalid >= 0);
337333
assert(PyUnicode_GET_LENGTH(s) > 0);
338334
if (invalid < PyUnicode_GET_LENGTH(s)) {
339335
Py_UCS4 ch = PyUnicode_READ_CHAR(s, invalid);

0 commit comments

Comments
 (0)