Skip to content

Commit acb8950

Browse files
committed
fixup! [3.14] gh-159620: Fix remote asyncio stacks stopping at async generators (GH-159623)
1 parent 6ed0144 commit acb8950

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

‎Lib/test/test_external_inspection.py‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,22 +1042,10 @@ async def main():
10421042
for _ in busy_retry(SHORT_TIMEOUT):
10431043
try:
10441044
all_awaited_by = get_all_awaited_by(p.pid)
1045-
except RuntimeError as re:
1046-
# This call reads a linked list in another process with
1047-
# no synchronization. That occasionally leads to invalid
1048-
# reads. Here we avoid making the test flaky.
1049-
msg = str(re)
1050-
if msg.startswith("Task list appears corrupted"):
1051-
continue
1052-
elif msg.startswith(
1053-
"Invalid linked list structure reading remote memory"
1054-
):
1055-
continue
1056-
elif msg.startswith("Unknown error reading memory"):
1057-
continue
1058-
elif msg.startswith("Unhandled frame owner"):
1059-
continue
1060-
raise # Unrecognized exception, safest not to ignore it
1045+
except RuntimeError:
1046+
# Tasks and awaited objects can change while we read
1047+
# the running process. Retry with a fresh sample.
1048+
continue
10611049
else:
10621050
break
10631051
# expected: a list of two elements: 1 thread, 1 interp

0 commit comments

Comments
 (0)