We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b50536 commit 1c1487cCopy full SHA for 1c1487c
1 file changed
Parser/pegen.c
@@ -941,10 +941,8 @@ _PyPegen_run_parser(Parser *p)
941
void *res = _PyPegen_parse(p);
942
assert(p->level == 0);
943
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.
+ // Discard a result returned with an exception still pending
+ // (e.g. a MemoryError from a recovered-from allocation failure).
948
return NULL;
949
}
950
if (res == NULL) {
0 commit comments