version_info cmd: better version for hidapi
was added in https://github.com/trezor/cython-hidapi/pull/143
This commit is contained in:
@@ -786,11 +786,15 @@ class DeviceMgr(ThreadJob):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
ret["libusb.path"] = None
|
ret["libusb.path"] = None
|
||||||
# add hidapi
|
# add hidapi
|
||||||
from importlib.metadata import version
|
|
||||||
try:
|
try:
|
||||||
ret["hidapi.version"] = version("hidapi") # FIXME does not work in macOS binary
|
import hid
|
||||||
except ImportError:
|
ret["hidapi.version"] = hid.__version__ # available starting with 0.12.0.post2
|
||||||
ret["hidapi.version"] = None
|
except Exception as e:
|
||||||
|
from importlib.metadata import version
|
||||||
|
try:
|
||||||
|
ret["hidapi.version"] = version("hidapi")
|
||||||
|
except ImportError:
|
||||||
|
ret["hidapi.version"] = None
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def trigger_pairings(
|
def trigger_pairings(
|
||||||
|
|||||||
Reference in New Issue
Block a user