Skip to content

Commit 5dd454d

Browse files
committed
Fix usages of Client.connect() to Client.try_connect()
1 parent cb6b2ed commit 5dd454d

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

cloudbot/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def try_connect(self):
7979
try:
8080
yield from self.connect(timeout)
8181
except Exception:
82-
logger.exception("[%s] Error occurred while connecting.")
82+
logger.exception("[%s] Error occurred while connecting.", self.name)
8383
else:
8484
break
8585

cloudbot/clients/irc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,14 @@ def connection_lost(self, exc):
307307
# we've been closed intentionally, so don't reconnect
308308
return
309309
logger.error("[{}] Connection lost: {}".format(self.conn.name, exc))
310-
async_util.wrap_future(self.conn.connect(), loop=self.loop)
310+
async_util.wrap_future(self.conn.try_connect(), loop=self.loop)
311311

312312
def eof_received(self):
313313
self._connected = False
314314
# create a new connected_future for when we are connected.
315315
self._connected_future = async_util.create_future(self.loop)
316316
logger.info("[{}] EOF received.".format(self.conn.name))
317-
async_util.wrap_future(self.conn.connect(), loop=self.loop)
317+
async_util.wrap_future(self.conn.try_connect(), loop=self.loop)
318318
return True
319319

320320
@asyncio.coroutine

plugins/core/check_conn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def conncheck(nick, bot, notice):
1515
notice("{}, {}".format(conn, bot.connections[conn].connected))
1616
# if the value is in fact false try to connect
1717
if not bot.connections[conn].connected:
18-
bot.connections[conn].connect()
18+
bot.connections[conn].try_connect()
1919
# Send a message from each irc network connection to the nick that issued the command
2020
bot.connections[conn].message(nick, "just letting you know I am here. {}".format(conn))
2121

@@ -27,7 +27,7 @@ def do_reconnect(conn):
2727
yield from asyncio.sleep(2)
2828
conn._quit = False
2929

30-
coro = conn.connect()
30+
coro = conn.try_connect()
3131
try:
3232
yield from asyncio.wait_for(coro, 30)
3333
except asyncio.TimeoutError:

0 commit comments

Comments
 (0)