Fix reconnect() type hint issues
This commit is contained in:
parent
aa1b457632
commit
e844004ba1
1 changed files with 6 additions and 1 deletions
|
@ -165,7 +165,12 @@ class Bot(object):
|
|||
event["timer"].redo()
|
||||
def reconnect(self, server_id: int, connection_params: typing.Optional[
|
||||
utils.irc.IRCConnectionParameters]=None) -> bool:
|
||||
server = self.add_server(server_id, False, connection_params.args)
|
||||
args = {} # type: typing.Dict[str, str]
|
||||
if not connection_params == None:
|
||||
args = typing.cast(utils.irc.IRCConnectionParameters,
|
||||
connection_params).args
|
||||
|
||||
server = self.add_server(server_id, False, args)
|
||||
if self.connect(server):
|
||||
self.servers[server.fileno()] = server
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue