From fc3dc3651b4c65c9349dfbd5abf6eedf4117d093 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 21 Jan 2025 14:04:18 -1000 Subject: [PATCH] chore: add pyupgrade to pre-commit (#71) --- .pre-commit-config.yaml | 5 +++++ src/bleak_esphome/backend/client.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 54f0976..5ef76d6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,6 +36,11 @@ repos: hooks: - id: prettier args: ["--tab-width", "2"] + - repo: https://github.com/asottile/pyupgrade + rev: v3.19.1 + hooks: + - id: pyupgrade + args: [--py311-plus] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.9.2 hooks: diff --git a/src/bleak_esphome/backend/client.py b/src/bleak_esphome/backend/client.py index 9888f13..a7ed48c 100644 --- a/src/bleak_esphome/backend/client.py +++ b/src/bleak_esphome/backend/client.py @@ -76,7 +76,7 @@ async def _async_wrap_bluetooth_operation( try: return await func(self, *args, **kwargs) except TimeoutAPIError as err: - raise asyncio.TimeoutError(str(err)) from err + raise TimeoutError(str(err)) from err except BluetoothConnectionDroppedError as ex: _LOGGER.debug( "%s: BLE device disconnected during %s operation",