Skip to content

Commit bb389e3

Browse files
committed
usbd: Implement ruff, black linter & formatting fixes.
1 parent 756d761 commit bb389e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

micropython/usbd/device.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def _open_cb(self, interface_desc_view):
300300
i = 0
301301
while i < len(interface_desc_view):
302302
# descriptor length, type, and index (if it's an interface descriptor)
303-
dl, dt, di = interface_desc_view[i:i+3]
303+
dl, dt, di = interface_desc_view[i : i + 3]
304304
if dt == _STD_DESC_INTERFACE_TYPE:
305305
if di >= self._usbd.static.itf_max:
306306
di -= self._usbd.static.itf_max
@@ -602,7 +602,7 @@ def submit_xfer(self, ep_addr, data, done_cb=None):
602602
# Note that done_cb may be called immediately, possibly before this
603603
# function has returned to the caller.
604604
if not self._open:
605-
raise RuntimeError()
605+
raise RuntimeError
606606
return get_usbdevice()._submit_xfer(ep_addr, data, done_cb)
607607

608608
def set_ep_stall(self, ep_addr, stall):
@@ -612,7 +612,7 @@ def set_ep_stall(self, ep_addr, stall):
612612
# there are some device classes that need to explicitly stall or unstall
613613
# an endpoint under certain conditions.
614614
if not self._open or ep_addr not in get_usbdevice()._eps:
615-
raise RuntimeError()
615+
raise RuntimeError
616616
get_usbdevice()._usbd.set_ep_stall(ep_addr, stall)
617617

618618
def get_ep_stall(self, ep_addr):
@@ -621,5 +621,5 @@ def get_ep_stall(self, ep_addr):
621621
# Endpoint can be stalled/unstalled by host, TinyUSB stack, or calls to
622622
# set_ep_stall().
623623
if not self._open or ep_addr not in get_usbdevice()._eps:
624-
raise RuntimeError()
624+
raise RuntimeError
625625
return get_usbdevice()._usbd.get_ep_stall(ep_addr)

0 commit comments

Comments
 (0)