Skip to content

Commit

Permalink
Change close to a coroutine in prep for session closing.
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Aug 14, 2019
1 parent dff56d3 commit a2bff28
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions twitchio/ext/commands/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ async def event_command_error(self, ctx, error):
error: :class:`.Exception`
The exception raised while trying to invoke the command.
"""
print('Ignoring exception in command: {0}:'.format(error), file=sys.stderr)
print(f'Ignoring exception in command: {error}:', file=sys.stderr)
traceback.print_exception(type(error), error, error.__traceback__, file=sys.stderr)

async def event_mode(self, channel, user, status):
Expand Down Expand Up @@ -563,7 +563,8 @@ def run(self):
except KeyboardInterrupt:
pass
finally:
self._connection._close()
self.loop.create_task(self.close())

def close(self):
async def close(self):
# TODO session close
self._connection._close()

0 comments on commit a2bff28

Please sign in to comment.