szastupov / aiotg

Asynchronous Python library for building Telegram bots
MIT License
382 stars 44 forks source link

Fixed two minor errors #63

Closed mon4ter closed 6 years ago

mon4ter commented 6 years ago

Since aiohttp 2.3 ClientSession.close() is a coroutine and the Bot.__del__() resuled in error.

/usr/lib/python3.6/site-packages/aiotg/bot.py:519: RuntimeWarning: coroutine 'ClientSession.close' was never awaited
  self._session.close()

On the way I notised an error after interrupting the bot.run() call.

ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending coro=<Bot._api_call() running at /home/dmitrygalkin/Projects/github/aiotg/aiotg/bot.py:354> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f88907f8828>()]> cb=[<TaskWakeupMethWrapper object at 0x7f88907f8738>()]>
szastupov commented 6 years ago

Neat! thanks 🙏