Skip to content

Commit be2d143

Browse files
committed
Prevent possible-unbound warning by collapsing state variables
1 parent a497e97 commit be2d143

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/workflows/services/common_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,14 @@ def start(self, **kwargs):
456456

457457
try:
458458
task = self.__queue.get(True, self._idle_time or 2)
459-
run_idle_task = False
460459
except queue.Empty:
461-
run_idle_task = True
460+
task = None
462461

463462
if self.transport and not self.transport.is_connected():
464463
raise workflows.Disconnected("Connection lost")
465464

466-
if run_idle_task:
465+
if task is None:
466+
# Run the idle task
467467
if self._idle_time:
468468
# run this outside the 'except' to avoid exception chaining
469469
self.__update_service_status(self.SERVICE_STATUS_TIMER)

0 commit comments

Comments
 (0)