summaryrefslogtreecommitdiff
path: root/tools/pydfu.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pydfu.py')
-rwxr-xr-xtools/pydfu.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/pydfu.py b/tools/pydfu.py
index 05cdf92c9..a9da3a0f8 100755
--- a/tools/pydfu.py
+++ b/tools/pydfu.py
@@ -77,7 +77,7 @@ __DFU_INTERFACE = 0
# Python 3 deprecated getargspec in favour of getfullargspec, but
# Python 2 doesn't have the latter, so detect which one to use
-getargspec = getattr(inspect, "getfullargspec", inspect.getargspec)
+getargspec = getattr(inspect, "getfullargspec", getattr(inspect, "getargspec", None))
if "length" in getargspec(usb.util.get_string).args:
# PyUSB 1.0.0.b1 has the length argument