summaryrefslogtreecommitdiff
path: root/plac/plac_ext.py
diff options
context:
space:
mode:
Diffstat (limited to 'plac/plac_ext.py')
-rw-r--r--plac/plac_ext.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/plac/plac_ext.py b/plac/plac_ext.py
index ae665b0..35106ae 100644
--- a/plac/plac_ext.py
+++ b/plac/plac_ext.py
@@ -721,7 +721,7 @@ class _AsynHandler(asynchat.async_chat):
line = ''.join(self.data)
self.log('Received line %r from %s' % (line, self.addr))
if line == 'EOF':
- self.i.__exit__()
+ self.i.__exit__(None, None, None)
self.handle_close()
else:
task = self.i.submit(line)
@@ -990,15 +990,11 @@ class Interpreter(object):
_AsynServer(self, _AsynHandler, port) # register the server
try:
asyncore.loop(**kw)
- except KeyboardInterrupt:
+ except (KeyboardInterrupt, TerminatedProcess):
pass
finally:
asyncore.close_all()
- def stop_server(self, after=0.0):
- "Stops the asyncore server, possibly after a given number of seconds"
- threading.Timer(after, asyncore.socket_map.clear).start()
-
def add_monitor(self, mon):
self.man.add(mon)