1
0

version_info cmd: better version for hidapi

was added in https://github.com/trezor/cython-hidapi/pull/143
This commit is contained in:
SomberNight
2023-05-30 22:54:26 +00:00
parent 1b9cb47623
commit 184281d2fc

View File

@@ -786,11 +786,15 @@ class DeviceMgr(ThreadJob):
except AttributeError:
ret["libusb.path"] = None
# add hidapi
from importlib.metadata import version
try:
ret["hidapi.version"] = version("hidapi") # FIXME does not work in macOS binary
except ImportError:
ret["hidapi.version"] = None
import hid
ret["hidapi.version"] = hid.__version__ # available starting with 0.12.0.post2
except Exception as e:
from importlib.metadata import version
try:
ret["hidapi.version"] = version("hidapi")
except ImportError:
ret["hidapi.version"] = None
return ret
def trigger_pairings(