diff --git a/homeassistant/components/control4/__init__.py b/homeassistant/components/control4/__init__.py index c9a6eab5c62..a3d0cebd1fc 100644 --- a/homeassistant/components/control4/__init__.py +++ b/homeassistant/components/control4/__init__.py @@ -50,7 +50,8 @@ PLATFORMS = [Platform.LIGHT, Platform.MEDIA_PLAYER] async def call_c4_api_retry(func, *func_args): """Call C4 API function and retry on failure.""" - for i in range(API_RETRY_TIMES): + # Ruff doesn't understand this loop - the exception is always raised after the retries + for i in range(API_RETRY_TIMES): # noqa: RET503 try: return await func(*func_args) except client_exceptions.ClientError as exception: diff --git a/homeassistant/components/recorder/pool.py b/homeassistant/components/recorder/pool.py index 0fa0e82e98b..30f8fa8d07a 100644 --- a/homeassistant/components/recorder/pool.py +++ b/homeassistant/components/recorder/pool.py @@ -100,7 +100,7 @@ class RecorderPool(SingletonThreadPool, NullPool): # which is allowed but discouraged since its much slower return self._do_get_db_connection_protected() # In the event loop, raise an exception - raise_for_blocking_call( + raise_for_blocking_call( # noqa: RET503 self._do_get_db_connection_protected, strict=True, advise_msg=ADVISE_MSG, diff --git a/homeassistant/components/stream/fmp4utils.py b/homeassistant/components/stream/fmp4utils.py index 255d75e3b79..5080678e3ca 100644 --- a/homeassistant/components/stream/fmp4utils.py +++ b/homeassistant/components/stream/fmp4utils.py @@ -149,7 +149,8 @@ def get_codec_string(mp4_bytes: bytes) -> str: def find_moov(mp4_io: BufferedIOBase) -> int: """Find location of moov atom in a BufferedIOBase mp4.""" index = 0 - while 1: + # Ruff doesn't understand this loop - the exception is always raised at the end + while 1: # noqa: RET503 mp4_io.seek(index) box_header = mp4_io.read(8) if len(box_header) != 8 or box_header[0:4] == b"\x00\x00\x00\x00": diff --git a/pyproject.toml b/pyproject.toml index 1cccc155d34..5f6324bbac5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -818,10 +818,7 @@ ignore = [ "ISC001", # Disabled because ruff does not understand type of __all__ generated by a function - "PLE0605", - - # temporarily disabled - "RET503" + "PLE0605" ] [tool.ruff.lint.flake8-import-conventions.extend-aliases]