From 28c0dd761f86019a2c8ba0b7445316f80aa83a6b Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Wed, 3 Dec 2025 17:44:25 +1100 Subject: [PATCH] Adjustment to make pyflakes happy re: timer --- bouquin/pomodoro_timer.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bouquin/pomodoro_timer.py b/bouquin/pomodoro_timer.py index e986122..50d5a69 100644 --- a/bouquin/pomodoro_timer.py +++ b/bouquin/pomodoro_timer.py @@ -3,7 +3,7 @@ from __future__ import annotations import math from typing import Optional -from PySide6.QtCore import Qt, QTimer, Signal, Slot, QSignalBlocker +from PySide6.QtCore import Qt, QTimer, Signal, Slot from PySide6.QtWidgets import ( QFrame, QVBoxLayout, @@ -167,9 +167,12 @@ class PomodoroManager: # Untoggle the toolbar button without retriggering the slot tool_bar = getattr(self._parent, "toolBar", None) if tool_bar is not None and hasattr(tool_bar, "actTimer"): - blocker = QSignalBlocker(tool_bar.actTimer) - tool_bar.actTimer.setChecked(False) - del blocker + action = tool_bar.actTimer + was_blocked = action.blockSignals(True) + try: + action.setChecked(False) + finally: + action.blockSignals(was_blocked) # Remove the embedded widget self.cancel_timer()