From 9ce30db34dc4b0e036a79fe557cad2d537067e97 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 7 Aug 2013 16:57:46 +0200 Subject: catch exception if tried to stop not running loop --- src/leap/mail/imap/fetch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/leap/mail/imap/fetch.py') diff --git a/src/leap/mail/imap/fetch.py b/src/leap/mail/imap/fetch.py index 1c41813..ee9de3e 100644 --- a/src/leap/mail/imap/fetch.py +++ b/src/leap/mail/imap/fetch.py @@ -93,7 +93,11 @@ class LeapIncomingMail(object): Stops the loop that fetches mail. """ if self._loop: - self._loop.stop() + try: + self._loop.stop() + except AssertionError: + logger.debug("It looks like we tried to stop a " + "loop that was not running.") def _sync_soledad(self): log.msg('syncing soledad...') -- cgit v1.2.3