network: oneserver should be bool

fix #4858
This commit is contained in:
SomberNight 2018-11-20 11:59:06 +01:00
parent 36f64d1ad9
commit 55963bd092
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -522,7 +522,7 @@ class Network(PrintError):
def _set_oneserver(self, oneserver: bool): def _set_oneserver(self, oneserver: bool):
self.num_server = 10 if not oneserver else 0 self.num_server = 10 if not oneserver else 0
self.oneserver = oneserver self.oneserver = bool(oneserver)
async def _switch_to_random_interface(self): async def _switch_to_random_interface(self):
'''Switch to a random connected server other than the current one''' '''Switch to a random connected server other than the current one'''
@ -817,7 +817,7 @@ class Network(PrintError):
self.protocol = deserialize_server(self.default_server)[2] self.protocol = deserialize_server(self.default_server)[2]
self.server_queue = queue.Queue() self.server_queue = queue.Queue()
self._set_proxy(deserialize_proxy(self.config.get('proxy'))) self._set_proxy(deserialize_proxy(self.config.get('proxy')))
self._set_oneserver(self.config.get('oneserver')) self._set_oneserver(self.config.get('oneserver', False))
self._start_interface(self.default_server) self._start_interface(self.default_server)
async def main(): async def main():