commit e7c51a10daf6ab718e25075814b68bee975e2704 Author: juga0 juga@riseup.net Date: Wed Jul 4 08:15:58 2018 +0000
Replace Exception by the possible exceptions --- sbws/util/stem.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sbws/util/stem.py b/sbws/util/stem.py index c4497b1..0c36d61 100644 --- a/sbws/util/stem.py +++ b/sbws/util/stem.py @@ -1,6 +1,7 @@ from stem.control import (Controller, Listener) from stem import (SocketError, InvalidRequest, UnsatisfiableRequest, - OperationFailed) + OperationFailed, ControllerError, InvalidArguments, + ProtocolError) from stem.connection import IncorrectSocketType import stem.process from configparser import ConfigParser @@ -79,7 +80,7 @@ def init_controller(port=None, path=None, set_custom_stream_settings=True): def is_bootstrapped(c): try: line = c.get_info('status/bootstrap-phase') - except Exception as e: + except (ControllerError, InvalidArguments, ProtocolError) as e: log.exception("Error trying to check bootstrap phase %s", e) return False state, _, progress, *_ = line.split()
tor-commits@lists.torproject.org