avoid stopping reactor if it's already in shutdown stage (where reactor.running is still True)

This commit is contained in:
Pablo Hoffman 2009-09-03 10:25:55 -03:00
parent 0643010f0c
commit be76490002
1 changed files with 3 additions and 1 deletions

View File

@ -65,8 +65,10 @@ class ExecutionEngine(object):
self.close_domain, domain, reason='shutdown')
if self._mainloop_task.running:
self._mainloop_task.stop()
if reactor.running:
try:
reactor.stop()
except RuntimeError: # raised if already stopped or in shutdown stage
pass
def kill(self):
"""Forces shutdown without waiting for pending transfers to finish.