From f077030dfc92f347b75df58aa77369ae925bb053 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 16 May 2013 02:37:06 +0100 Subject: [PATCH] ConsoleUI: quit command now gracefully handles stopping a stopped reactor --- deluge/ui/console/commands/quit.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deluge/ui/console/commands/quit.py b/deluge/ui/console/commands/quit.py index 1c95f9461..210b9a64d 100644 --- a/deluge/ui/console/commands/quit.py +++ b/deluge/ui/console/commands/quit.py @@ -35,7 +35,7 @@ # from deluge.ui.client import client from deluge.ui.console.main import BaseCommand -from twisted.internet import reactor +from twisted.internet import reactor, error class Command(BaseCommand): """Exit from the client.""" @@ -47,4 +47,7 @@ class Command(BaseCommand): reactor.stop() return client.disconnect().addCallback(on_disconnect) else: - reactor.stop() + try: + reactor.stop() + except error.ReactorNotRunning: + pass