Commit aabda676 authored by Jason Madden's avatar Jason Madden

Avoid 'dictionary size changed during iteration' on python 3 when reaping children.

parent ff1fc0fa
......@@ -137,10 +137,11 @@ if hasattr(os, 'fork'):
# for the *timeout*
now = time.time()
oldest_allowed = now - timeout
for pid in _watched_children.keys():
val = _watched_children[pid]
if isinstance(val, tuple) and val[2] < oldest_allowed:
del _watched_children[pid]
dead = [pid for pid, val
in _watched_children.items()
if isinstance(val, tuple) and val[2] < oldest_allowed]
for pid in dead:
del _watched_children[pid]
def waitpid(pid, options):
# XXX Does not handle tracing children
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment