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'): ...@@ -137,10 +137,11 @@ if hasattr(os, 'fork'):
# for the *timeout* # for the *timeout*
now = time.time() now = time.time()
oldest_allowed = now - timeout oldest_allowed = now - timeout
for pid in _watched_children.keys(): dead = [pid for pid, val
val = _watched_children[pid] in _watched_children.items()
if isinstance(val, tuple) and val[2] < oldest_allowed: if isinstance(val, tuple) and val[2] < oldest_allowed]
del _watched_children[pid] for pid in dead:
del _watched_children[pid]
def waitpid(pid, options): def waitpid(pid, options):
# XXX Does not handle tracing children # 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