Commit ce8148aa authored by Martín Ferrari's avatar Martín Ferrari

Remove unneeded import; avoid duplicate checks in cleanup().

parent f23135ea
# vim:ts=4:sw=4:et:ai:sts=4 # vim:ts=4:sw=4:et:ai:sts=4
import errno, os, socket, sys, traceback, unshare, weakref import os, socket, sys, traceback, unshare, weakref
from netns.environ import * from netns.environ import *
import netns.interface, netns.protocol, netns.subprocess_ import netns.interface, netns.protocol, netns.subprocess_
......
...@@ -97,9 +97,9 @@ class Server(object): ...@@ -97,9 +97,9 @@ class Server(object):
# -PID to kill to whole process group # -PID to kill to whole process group
os.kill(-pid, signal.SIGTERM) os.kill(-pid, signal.SIGTERM)
now = time.time() now = time.time()
ch = self._children ch = set(self._children)
while time.time() - now < KILL_WAIT: while time.time() - now < KILL_WAIT:
for pid in set(ch): for pid in ch:
try: try:
if netns.subprocess_.poll(pid): if netns.subprocess_.poll(pid):
ch.remove(pid) ch.remove(pid)
......
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