From 856d99cf6127c09c468197ad0d1f5f177fd58212 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Mon, 5 Oct 2026 17:15:47 -0400 Subject: [PATCH] fix(vegas): type the static pause fallback on its own (mypy ratchet) _static_pause_duration assigned the fallback to `seconds`, which the except branch typed as float before finite_seconds() reassigned it as float | None. A separate `fallback` keeps both types exact; behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 --- src/vegas_mode/coordinator.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vegas_mode/coordinator.py b/src/vegas_mode/coordinator.py index 62825526..8c296c60 100644 --- a/src/vegas_mode/coordinator.py +++ b/src/vegas_mode/coordinator.py @@ -1076,23 +1076,23 @@ class VegasModeCoordinator: value = plugin.get_display_duration() except Exception as err: # pylint: disable=broad-except problem = f"get_display_duration() raised {type(err).__name__}: {err}" - seconds = _UNREADABLE_DURATION + fallback = _UNREADABLE_DURATION else: seconds = finite_seconds(value) if seconds is not None and seconds > 0: return seconds if seconds is None: problem = f"display duration {value!r} is not a number" - seconds = _UNREADABLE_DURATION + fallback = _UNREADABLE_DURATION else: problem = f"display duration {value!r} is not above zero" - seconds = _NOT_POSITIVE_DURATION + fallback = _NOT_POSITIVE_DURATION plugin_id = plugin.plugin_id if plugin_id not in self._duration_warned: self._duration_warned = self._duration_warned | {plugin_id} logger.warning("[%s] %s; its static pause lasts %.0fs (logged once)", - plugin_id, problem, seconds) - return seconds + plugin_id, problem, fallback) + return fallback def _end_static_pause(self) -> None: """End static pause and restore scroll state."""