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:
|
if shared.tor:
|
||||||
try:
|
try:
|
||||||
from . import tor # pylint: disable=import-outside-toplevel
|
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():
|
if not tor.start_tor_service():
|
||||||
logging.warning('The tor service has not started.')
|
logging.warning('The tor service has not started.')
|
||||||
tor = None
|
tor = None
|
||||||
|
except ImportError:
|
||||||
|
logging.info('Failed to import tor module.', exc_info=True)
|
||||||
|
tor = None
|
||||||
|
|
||||||
if not tor:
|
if not tor:
|
||||||
try:
|
try:
|
||||||
socket.socket().bind(('127.0.0.1', 9050))
|
socket.socket().bind(('127.0.0.1', 9050))
|
||||||
return
|
return
|
||||||
except (OSError, socket.error):
|
except (OSError, socket.error):
|
||||||
pass
|
pass
|
||||||
|
elif shared.ip_enabled and not shared.trusted_peer:
|
||||||
if shared.ip_enabled and not shared.trusted_peer and not shared.tor:
|
|
||||||
bootstrap_from_dns()
|
bootstrap_from_dns()
|
||||||
|
|
||||||
if shared.i2p_enabled:
|
if shared.i2p_enabled:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user