Handle pylint too-many-branches in main.main()
This commit is contained in:
parent
fe6a6af1db
commit
9732f0c7f5
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user