From 7424b120b5092b88f6b50bd97fea6f841749071c Mon Sep 17 00:00:00 2001 From: HLammers <62934625+HLammers@users.noreply.github.com> Date: Sat, 5 Jul 2025 14:33:41 +0200 Subject: [PATCH] Moved assignment out of assert statement --- micropython/usb/usb-device/usb/device/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/micropython/usb/usb-device/usb/device/core.py b/micropython/usb/usb-device/usb/device/core.py index 9e1ba174..a3e603d7 100644 --- a/micropython/usb/usb-device/usb/device/core.py +++ b/micropython/usb/usb-device/usb/device/core.py @@ -830,8 +830,8 @@ class Buffer: # Called by the producer to indicate it wrote nbytes into the buffer. ist = machine.disable_irq() try: - assert nbytes <= self._l - (_w := self._w) # can't say we wrote more than was pended - if self._n == _w: + assert nbytes <= self._l - self._w # can't say we wrote more than was pended + if self._n == self._w: # no data was read while the write was happening, so the buffer is already in place # (this is the fast path) self._n += nbytes