mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-22 14:35:00 +01:00
Stabilize Application.run_*
on Python 3.7 (#3009)
This commit is contained in:
parent
be8f4f7aad
commit
a299867b1b
2 changed files with 9 additions and 0 deletions
|
@ -309,6 +309,10 @@ class Updater(AbstractAsyncContextManager):
|
|||
pool_timeout=pool_timeout,
|
||||
allowed_updates=allowed_updates,
|
||||
)
|
||||
except asyncio.CancelledError as exc:
|
||||
# TODO: in py3.8+, CancelledError is a subclass of BaseException, so we can drop
|
||||
# this clause when we drop py3.7
|
||||
raise exc
|
||||
except TelegramError as exc:
|
||||
# TelegramErrors should be processed by the network retry loop
|
||||
raise exc
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||
"""This module contains an abstract class to make POST and GET requests."""
|
||||
import abc
|
||||
import asyncio
|
||||
from contextlib import AbstractAsyncContextManager
|
||||
from http import HTTPStatus
|
||||
from types import TracebackType
|
||||
|
@ -275,6 +276,10 @@ class BaseRequest(
|
|||
connect_timeout=connect_timeout,
|
||||
pool_timeout=pool_timeout,
|
||||
)
|
||||
except asyncio.CancelledError as exc:
|
||||
# TODO: in py3.8+, CancelledError is a subclass of BaseException, so we can drop this
|
||||
# clause when we drop py3.7
|
||||
raise exc
|
||||
except TelegramError as exc:
|
||||
raise exc
|
||||
except Exception as exc:
|
||||
|
|
Loading…
Reference in a new issue