mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
python-bindings: catch timeout
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
from queue import Queue
|
from queue import Queue, Empty
|
||||||
from threading import Event
|
from threading import Event
|
||||||
|
|
||||||
from .hookspec import account_hookimpl, Global
|
from .hookspec import account_hookimpl, Global
|
||||||
@@ -93,8 +93,12 @@ class ConfigureTracker:
|
|||||||
def wait_finish(self, timeout=None):
|
def wait_finish(self, timeout=None):
|
||||||
""" wait until configure is completed.
|
""" wait until configure is completed.
|
||||||
|
|
||||||
Raise Exception if Configure failed
|
:param timeout: how many seconds until configuring is given up.
|
||||||
|
:raises: ConfigureFailed if Configured failed or timeout reached.
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
if not self._configure_events.get(timeout=timeout):
|
if not self._configure_events.get(timeout=timeout):
|
||||||
content = "\n".join(map(str, self._ffi_events))
|
content = "\n".join(map(str, self._ffi_events))
|
||||||
raise ConfigureFailed(content)
|
raise ConfigureFailed(content)
|
||||||
|
except Empty:
|
||||||
|
raise ConfigureFailed(content)
|
||||||
|
|||||||
Reference in New Issue
Block a user