aboutsummaryrefslogtreecommitdiff
path: root/ayatanawebmail
diff options
context:
space:
mode:
authorIngo Meyer <IJ_M@gmx.de>2022-04-04 13:06:13 +0200
committerIngo Meyer <IJ_M@gmx.de>2022-04-04 13:06:13 +0200
commit7458995eee98a239911c0a0f379551adc6bf823b (patch)
tree47e9a5569bc66ac48d1ae09a8fc5593692dbf3d3 /ayatanawebmail
parent30a122bd280cff496219eba15a48f7fb0381f46f (diff)
downloadayatana-webmail-7458995eee98a239911c0a0f379551adc6bf823b.tar.gz
ayatana-webmail-7458995eee98a239911c0a0f379551adc6bf823b.tar.bz2
ayatana-webmail-7458995eee98a239911c0a0f379551adc6bf823b.zip
Do not fail in the idler stop method on connection drops
On connection drops or standby events, sending a `noop` command is not possible, and leads to a failing `stop` method in the `Idler` class. This commit adds a try/except block to ignore that error case, since it is not relevant for the `stop` method.
Diffstat (limited to 'ayatanawebmail')
-rwxr-xr-xayatanawebmail/idler.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ayatanawebmail/idler.py b/ayatanawebmail/idler.py
index 3e852a1..b6b63b4 100755
--- a/ayatanawebmail/idler.py
+++ b/ayatanawebmail/idler.py
@@ -23,8 +23,11 @@ class Idler(object):
def stop(self):
if self.oConnection.oImap is not None:
- # Send a NOOP command to interrupt the IDLE mode and free the blocked thread
- self.oConnection.oImap.noop()
+ try:
+ # Send a NOOP command to interrupt the IDLE mode and free the blocked thread
+ self.oConnection.oImap.noop()
+ except:
+ pass
self.oEvent.set()
def join(self):