diff --git a/telegrambot.py b/telegrambot.py index d501e987..000b4f53 100644 --- a/telegrambot.py +++ b/telegrambot.py @@ -510,6 +510,7 @@ def on_callback_query(bot: telegram.Bot, update: telegram.Update): sentry.captureException() finally: try: + # noinspection PyUnboundLocalVariable session.close() except Exception: pass