diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a15b1f1bf4a..e0d933ea11c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,11 +25,11 @@ repos: - --diff - --check - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 - repo: https://github.com/PyCQA/pylint - rev: v3.1.0 + rev: v3.2.4 hooks: - id: pylint files: ^(?!(tests|docs)).*\.py$ @@ -41,7 +41,7 @@ repos: - aiolimiter~=1.1.0 - . # this basically does `pip install -e .` - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.0 + rev: v1.10.1 hooks: - id: mypy name: mypy-ptb @@ -68,7 +68,7 @@ repos: - cachetools~=5.3.3 - . # this basically does `pip install -e .` - repo: https://github.com/asottile/pyupgrade - rev: v3.15.2 + rev: v3.16.0 hooks: - id: pyupgrade args: diff --git a/telegram/ext/_applicationbuilder.py b/telegram/ext/_applicationbuilder.py index 2da56279941..a54d491614b 100644 --- a/telegram/ext/_applicationbuilder.py +++ b/telegram/ext/_applicationbuilder.py @@ -322,9 +322,7 @@ def build( bot = self._updater.bot update_queue = self._updater.update_queue - application: Application[ - BT, CCT, UD, CD, BD, JQ - ] = DefaultValue.get_value( # pylint: disable=not-callable + application: Application[BT, CCT, UD, CD, BD, JQ] = DefaultValue.get_value( self._application_class )( bot=bot, diff --git a/telegram/ext/_callbackdatacache.py b/telegram/ext/_callbackdatacache.py index 893150b480d..150f3f055b0 100644 --- a/telegram/ext/_callbackdatacache.py +++ b/telegram/ext/_callbackdatacache.py @@ -30,6 +30,8 @@ CACHE_TOOLS_AVAILABLE = False +import contextlib + from telegram import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup, Message, User from telegram._utils.datetime import to_float_timestamp from telegram.error import TelegramError @@ -425,10 +427,8 @@ def drop_data(self, callback_query: CallbackQuery) -> None: raise KeyError("CallbackQuery was not found in cache.") from exc def __drop_keyboard(self, keyboard_uuid: str) -> None: - try: + with contextlib.suppress(KeyError): self._keyboard_data.pop(keyboard_uuid) - except KeyError: - return def clear_callback_data(self, time_cutoff: Optional[Union[float, datetime]] = None) -> None: """Clears the stored callback data.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: