Skip to content

Commit

Permalink
Killswitch: Use pathlib to check for /dev/rfkill
Browse files Browse the repository at this point in the history
  • Loading branch information
infirit committed Dec 23, 2024
1 parent b371810 commit 82784fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion blueman/plugins/applet/KillSwitch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from gettext import gettext as _
import os
import pathlib
from typing import Any
from collections.abc import Callable

Expand All @@ -21,7 +22,7 @@

RFKILL_EVENT_SIZE_V1 = 8

if not os.path.exists('/dev/rfkill'):
if not pathlib.Path('/dev/rfkill').exists():
raise ImportError('Hardware kill switch not found')


Expand Down
4 changes: 2 additions & 2 deletions blueman/plugins/mechanism/RfKill.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
import pathlib
import struct
from blueman.plugins.MechanismPlugin import MechanismPlugin
from blueman.plugins.applet.KillSwitch import RFKILL_TYPE_BLUETOOTH, RFKILL_OP_CHANGE_ALL

if not os.path.exists('/dev/rfkill'):
if not pathlib.Path('/dev/rfkill').exists():
raise ImportError("Hardware kill switch not found")


Expand Down

0 comments on commit 82784fb

Please sign in to comment.