From 9732f0c7f5a88dea6d63d2c85363219289948a22 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Fri, 21 Feb 2025 03:26:10 +0200 Subject: [PATCH] Handle pylint too-many-branches in main.main() --- minode/main.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/minode/main.py b/minode/main.py index 461adee..050e639 100644 --- a/minode/main.py +++ b/minode/main.py @@ -281,21 +281,20 @@ def main(): if shared.tor: try: from . import tor # pylint: disable=import-outside-toplevel - except ImportError: - logging.info('Failed to import tor module.', exc_info=True) - tor = None - else: if not tor.start_tor_service(): logging.warning('The tor service has not started.') tor = None + except ImportError: + logging.info('Failed to import tor module.', exc_info=True) + tor = None + if not tor: try: socket.socket().bind(('127.0.0.1', 9050)) return except (OSError, socket.error): pass - - if shared.ip_enabled and not shared.trusted_peer and not shared.tor: + elif shared.ip_enabled and not shared.trusted_peer: bootstrap_from_dns() if shared.i2p_enabled: