aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2019-05-01 17:13:55 +0100
committerGravatar jesopo2019-05-01 17:13:55 +0100
commite844004ba131f67884bf36e78a354b0484dab290 (patch)
treef32a076346aa3c5bd966ea959bb42c435fbab26f /src
parentChange TRIGGER_RETURN and TRIGGER_EXCEPTION to an enum (diff)
signature
Fix reconnect() type hint issues
Diffstat (limited to 'src')
-rw-r--r--src/IRCBot.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/IRCBot.py b/src/IRCBot.py
index 0c4f2784..8879b328 100644
--- a/src/IRCBot.py
+++ b/src/IRCBot.py
@@ -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