Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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$
Expand All @@ -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
Expand All @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions telegram/ext/_applicationbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions telegram/ext/_callbackdatacache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down