Skip to content

Commit

Permalink
Added backwards compatibility for watchdog's dispatch_events() call.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Žaja committed Nov 5, 2022
1 parent 36af772 commit 8d18ccc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = refind_btrfs
version = 0.5.5
version = 0.5.6
description = Generate rEFInd manual boot stanzas from Btrfs snapshots
long_description = file: README.md
keywords = rEFInd, btrfs
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

setuptools.setup(
name="refind-btrfs",
version="0.5.5",
version="0.5.6",
author="Luka Žaja",
author_email="[email protected]",
description="Generate rEFInd manual boot stanzas from Btrfs snapshots",
Expand Down
12 changes: 11 additions & 1 deletion src/refind_btrfs/service/snapshot_observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

import queue

from inspect import signature
from typing import Any

from injector import inject

from refind_btrfs.common import CheckableObserver, constants
Expand All @@ -42,7 +45,14 @@ def run(self) -> None:

while self.should_keep_running():
try:
self.dispatch_events(self.event_queue)
arguments: list[Any] = [self.event_queue]
dispatch_events_signature = signature(self.dispatch_events)
parameters = dispatch_events_signature.parameters

if "timeout" in parameters:
arguments.append(self.timeout)

self.dispatch_events(*arguments)
except queue.Empty:
continue
except SnapshotMountedAsRootError as e:
Expand Down

0 comments on commit 8d18ccc

Please sign in to comment.