Skip to content

Commit bb3f88f

Browse files
committed
Tinyweb: Python linting.
1 parent 65983ec commit bb3f88f

File tree

1 file changed

+4
-4
lines changed
  • micropython/examples/common/lib/tinyweb

1 file changed

+4
-4
lines changed

micropython/examples/common/lib/tinyweb/server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
type_gen = type((lambda: (yield))())
1919

20-
# with v1.21.0 release all u-modules where renamend without the u prefix
20+
# with v1.21.0 release all u-modules where renamend without the u prefix
2121
# -> uasyncio no named asyncio
2222
# asyncio v3 is shipped with MicroPython 1.13, and contains some subtle
2323
# but breaking changes. See also https://github.com/peterhinch/micropython-async/blob/master/v3/README.md
@@ -350,13 +350,13 @@ async def restful_resource_handler(req, resp, param=None):
350350
gc.collect()
351351
await resp.send('0\r\n\r\n')
352352
else:
353-
if type(res) == tuple:
353+
if isinstance(res, tuple):
354354
resp.code = res[1]
355355
res = res[0]
356356
elif res is None:
357357
raise Exception('Result expected')
358358
# Send response
359-
if type(res) is dict:
359+
if isinstance(res, dict):
360360
res_str = json.dumps(res)
361361
else:
362362
res_str = res
@@ -491,7 +491,7 @@ async def _handler(self, reader, writer):
491491
# Send exception info if desired
492492
if self.debug:
493493
sys.print_exception(e, resp.writer.s)
494-
except Exception as e:
494+
except Exception:
495495
pass
496496
finally:
497497
await writer.aclose()

0 commit comments

Comments
 (0)