Skip to content

Commit

Permalink
drop cancellederror
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya committed Jun 13, 2023
1 parent 63fd846 commit f72b462
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
4 changes: 0 additions & 4 deletions telegram/ext/_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,10 +1027,6 @@ async def __create_task_callback(
if isinstance(coroutine, Generator):
return await asyncio.create_task(coroutine)
return await coroutine
except asyncio.CancelledError as cancel:
# TODO: in py3.8+, CancelledError is a subclass of BaseException, so we can drop this
# clause when we drop py3.7
raise cancel
except Exception as exception:
if isinstance(exception, ApplicationHandlerStop):
warn(
Expand Down
4 changes: 0 additions & 4 deletions telegram/ext/_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,6 @@ async def polling_action_cb() -> bool:
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
Expand Down
5 changes: 0 additions & 5 deletions telegram/request/_baserequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# 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
import json
from http import HTTPStatus
from types import TracebackType
Expand Down Expand Up @@ -283,10 +282,6 @@ async def _request_wrapper(
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:
Expand Down

0 comments on commit f72b462

Please sign in to comment.