From 1c95d32b527a9f6f69c5a2d5a3a1b6a4fa96667d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:11:42 +0000 Subject: [PATCH 1/2] Bump `pre-commit` Hooks to Latest Versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/7.0.0...7.1.0) - [github.com/PyCQA/pylint: v3.1.0 → v3.2.4](https://github.com/PyCQA/pylint/compare/v3.1.0...v3.2.4) - [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.10.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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: From 1761211af6a3079875999c098a2b2251ff85b435 Mon Sep 17 00:00:00 2001 From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:16:50 +0200 Subject: [PATCH 2/2] fix pre-commit --- telegram/ext/_applicationbuilder.py | 4 +--- telegram/ext/_callbackdatacache.py | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) 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. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy