Handle pylint too-many-branches in main.main()

This commit is contained in:
Lee Miller 2025-02-21 03:26:10 +02:00
parent fe6a6af1db
commit 9732f0c7f5
Signed by: lee.miller
GPG Key ID: 4F97A5EA88F4AB63

View File

@ -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: