blob: 8b946c7cf6f6222cb26cedf6a571cd760f7765f8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
--- blinkstick/blinkstick.py.orig 2023-05-04 08:45:38 UTC
+++ blinkstick/blinkstick.py
@@ -1,4 +1,5 @@ from ._version import __version__
from ._version import __version__
+import os
import time
import sys
import re
@@ -820,7 +821,7 @@ class BlinkStick(object):
if self.device is None:
raise BlinkStickException("Could not find BlinkStick...")
- if self.device.is_kernel_driver_active(0):
+ if os.geteuid() == 0 and self.device.is_kernel_driver_active(0):
try:
self.device.detach_kernel_driver(0)
except usb.core.USBError as e:
|