Skip to content

Commit 1c1487c

Browse files
committed
Shorten the comment on the pending-exception guard
1 parent 7b50536 commit 1c1487c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Parser/pegen.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -941,10 +941,8 @@ _PyPegen_run_parser(Parser *p)
941941
void *res = _PyPegen_parse(p);
942942
assert(p->level == 0);
943943
if (res != NULL && PyErr_Occurred()) {
944-
// The parser produced a result but left an exception pending, which
945-
// happens when an allocation fails in a path the parser recovers from
946-
// (for example while memoizing). The result cannot be trusted, so
947-
// discard it and let the pending exception (a MemoryError) propagate.
944+
// Discard a result returned with an exception still pending
945+
// (e.g. a MemoryError from a recovered-from allocation failure).
948946
return NULL;
949947
}
950948
if (res == NULL) {

0 commit comments

Comments
 (0)