mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[build] Fix DFU on recent Python versions and drop Python 2
This commit is contained in:
@@ -79,7 +79,7 @@ __DFU_INTERFACE = 0
|
|||||||
# Python 3 deprecated getargspec in favour of getfullargspec, but
|
# Python 3 deprecated getargspec in favour of getfullargspec, but
|
||||||
# Python 2 doesn't have the latter, so detect which one to use
|
# Python 2 doesn't have the latter, so detect which one to use
|
||||||
import inspect
|
import inspect
|
||||||
getargspec = getattr(inspect, 'getfullargspec', inspect.getargspec)
|
getargspec = getattr(inspect, 'getfullargspec', inspect.getfullargspec)
|
||||||
|
|
||||||
if 'length' in getargspec(usb.util.get_string).args:
|
if 'length' in getargspec(usb.util.get_string).args:
|
||||||
# PyUSB 1.0.0.b1 has the length argument
|
# PyUSB 1.0.0.b1 has the length argument
|
||||||
|
|||||||
Reference in New Issue
Block a user