Skip to content

Commit ed7a3b1

Browse files
committed
tools/pydfu.py: Use getattr to retrieve getargspec function.
Since Python 3.11, inspect.getargspec() has been removed. Signed-off-by: Damien George <[email protected]>
1 parent 324d01e commit ed7a3b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/pydfu.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777

7878
# Python 3 deprecated getargspec in favour of getfullargspec, but
7979
# Python 2 doesn't have the latter, so detect which one to use
80-
getargspec = getattr(inspect, "getfullargspec", inspect.getargspec)
80+
getargspec = getattr(inspect, "getfullargspec", getattr(inspect, "getargspec", None))
8181

8282
if "length" in getargspec(usb.util.get_string).args:
8383
# PyUSB 1.0.0.b1 has the length argument

0 commit comments

Comments
 (0)