diff --git a/micropython/bluetooth/aioble/examples/l2cap_file_client.py b/micropython/bluetooth/aioble/examples/l2cap_file_client.py index 68770f04..54b357d4 100644 --- a/micropython/bluetooth/aioble/examples/l2cap_file_client.py +++ b/micropython/bluetooth/aioble/examples/l2cap_file_client.py @@ -85,7 +85,7 @@ class FileClient: async def download(self, path, dest): size = await self.size(path) - send_seq = await self._command(_COMMAND_SEND, path.encode()) + await self._command(_COMMAND_SEND, path.encode()) with open(dest, "wb") as f: # noqa: ASYNC101 total = 0 @@ -97,7 +97,7 @@ class FileClient: total += n async def list(self, path): - send_seq = await self._command(_COMMAND_LIST, path.encode()) + await self._command(_COMMAND_LIST, path.encode()) results = bytearray() buf = bytearray(self._channel.our_mtu) mv = memoryview(buf) diff --git a/micropython/bluetooth/aioble/examples/l2cap_file_server.py b/micropython/bluetooth/aioble/examples/l2cap_file_server.py index c3730ffd..c6aef658 100644 --- a/micropython/bluetooth/aioble/examples/l2cap_file_server.py +++ b/micropython/bluetooth/aioble/examples/l2cap_file_server.py @@ -132,15 +132,12 @@ async def control_task(connection): file = msg[2:].decode() if command == _COMMAND_SEND: - op_seq = seq send_file = file l2cap_event.set() elif command == _COMMAND_RECV: - op_seq = seq recv_file = file l2cap_event.set() elif command == _COMMAND_LIST: - op_seq = seq list_path = file l2cap_event.set() elif command == _COMMAND_SIZE: @@ -148,7 +145,7 @@ async def control_task(connection): stat = os.stat(file) size = stat[6] status = 0 - except OSError as e: + except OSError: size = 0 status = _STATUS_NOT_FOUND control_characteristic.notify( diff --git a/micropython/bluetooth/aioble/multitests/ble_descriptor.py b/micropython/bluetooth/aioble/multitests/ble_descriptor.py index 2354dff6..c45f1413 100644 --- a/micropython/bluetooth/aioble/multitests/ble_descriptor.py +++ b/micropython/bluetooth/aioble/multitests/ble_descriptor.py @@ -32,9 +32,7 @@ async def instance0_task(): char1_desc1.write("char1_desc1") char1_desc2 = aioble.Descriptor(char1, CHAR1_DESC2_UUID, read=True, write=True) char1_desc2.write("char1_desc2") - char2 = aioble.Characteristic( - service, CHAR2_UUID, read=True, write=True, notify=True, indicate=True - ) + aioble.Characteristic(service, CHAR2_UUID, read=True, write=True, notify=True, indicate=True) char3 = aioble.Characteristic( service, CHAR3_UUID, read=True, write=True, notify=True, indicate=True ) diff --git a/micropython/espflash/espflash.py b/micropython/espflash/espflash.py index cc025836..6d958340 100644 --- a/micropython/espflash/espflash.py +++ b/micropython/espflash/espflash.py @@ -258,7 +258,6 @@ class ESPFlash: print(f"Flash write size: {size} total_blocks: {total_blocks} block size: {blksize}") with open(path, "rb") as f: seq = 0 - subseq = 0 for i in range(total_blocks): buf = f.read(blksize) # Update digest diff --git a/micropython/ucontextlib/tests.py b/micropython/ucontextlib/tests.py index 4fd026ae..163175d8 100644 --- a/micropython/ucontextlib/tests.py +++ b/micropython/ucontextlib/tests.py @@ -24,7 +24,7 @@ class ContextManagerTestCase(unittest.TestCase): def test_context_manager_on_error(self): exc = Exception() try: - with self._manager(123) as x: + with self._manager(123): raise exc except Exception as e: self.assertEqual(exc, e) diff --git a/micropython/udnspkt/udnspkt.py b/micropython/udnspkt/udnspkt.py index e5528597..2cb11ab9 100644 --- a/micropython/udnspkt/udnspkt.py +++ b/micropython/udnspkt/udnspkt.py @@ -43,36 +43,28 @@ def parse_resp(buf, is_ipv6): if is_ipv6: typ = 28 # AAAA - id = buf.readbin(">H") + buf.readbin(">H") # id flags = buf.readbin(">H") assert flags & 0x8000 - qcnt = buf.readbin(">H") + buf.readbin(">H") # qcnt acnt = buf.readbin(">H") - nscnt = buf.readbin(">H") - addcnt = buf.readbin(">H") - # print(qcnt, acnt, nscnt, addcnt) + buf.readbin(">H") # nscnt + buf.readbin(">H") # addcnt skip_fqdn(buf) - v = buf.readbin(">H") - # print(v) - v = buf.readbin(">H") - # print(v) + buf.readbin(">H") + buf.readbin(">H") for i in range(acnt): # print("Resp #%d" % i) # v = read_fqdn(buf) # print(v) skip_fqdn(buf) - t = buf.readbin(">H") - # print("Type", t) - v = buf.readbin(">H") - # print("Class", v) - v = buf.readbin(">I") - # print("TTL", v) + t = buf.readbin(">H") # Type + buf.readbin(">H") # Class + buf.readbin(">I") # TTL rlen = buf.readbin(">H") - # print("rlen", rlen) rval = buf.read(rlen) - # print(rval) if t == typ: return rval diff --git a/micropython/urllib.urequest/urllib/urequest.py b/micropython/urllib.urequest/urllib/urequest.py index 2eff43c3..5154c0f0 100644 --- a/micropython/urllib.urequest/urllib/urequest.py +++ b/micropython/urllib.urequest/urllib/urequest.py @@ -48,10 +48,10 @@ def urlopen(url, data=None, method="GET"): if data: s.write(data) - l = s.readline() - l = l.split(None, 2) + l = s.readline() # Status-Line + # l = l.split(None, 2) # print(l) - status = int(l[1]) + # status = int(l[1]) # FIXME: Status-Code element is not currently checked while True: l = s.readline() if not l or l == b"\r\n": diff --git a/pyproject.toml b/pyproject.toml index 3b252454..15bb0537 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,6 @@ ignore = [ "F405", "E501", "F541", - "F841", "ISC001", "ISC003", # micropython does not support implicit concatenation of f-strings "PIE810", # micropython does not support passing tuples to .startswith or .endswith diff --git a/python-ecosys/aiohttp/aiohttp/__init__.py b/python-ecosys/aiohttp/aiohttp/__init__.py index 23d227a6..79a676de 100644 --- a/python-ecosys/aiohttp/aiohttp/__init__.py +++ b/python-ecosys/aiohttp/aiohttp/__init__.py @@ -104,7 +104,6 @@ class ClientSession: async def _request(self, method, url, data=None, json=None, ssl=None, params=None, headers={}): redir_cnt = 0 - redir_url = None while redir_cnt < 2: reader = await self.request_raw(method, url, data, json, ssl, params, headers) _headers = [] diff --git a/python-ecosys/cbor2/cbor2/_decoder.py b/python-ecosys/cbor2/cbor2/_decoder.py index e38f078f..5d509a53 100644 --- a/python-ecosys/cbor2/cbor2/_decoder.py +++ b/python-ecosys/cbor2/cbor2/_decoder.py @@ -159,7 +159,7 @@ def decode_simple_value(decoder): def decode_float16(decoder): - payload = decoder.read(2) + decoder.read(2) raise NotImplementedError # no float16 unpack function