mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
all: Fix various Python coding inconsistencies found by ruff.
This fixes:
- type-comparison (E721): do not compare types, use isinstance().
- string-dot-format-missing-arguments (F524): .format call is missing
argument(s) for placeholder(s): {message}.
- f-string-missing-placeholders (F541).
- is-literal (F632): Use != to compare constant literals.
The last one is fixed by just comparing for truthfulness of `state`.
This commit is contained in:
committed by
Damien George
parent
8f8bd98164
commit
79e57473b2
@@ -36,7 +36,7 @@ def create_c_from_file(c_filename, zip_filename):
|
||||
break
|
||||
print(' ', end='', file=c_file)
|
||||
for byte in buf:
|
||||
if type(byte) is types.StringType:
|
||||
if isinstance(byte, types.StringType):
|
||||
print(' 0x{:02x},'.format(ord(byte)), end='', file=c_file)
|
||||
else:
|
||||
print(' 0x{:02x},'.format(byte), end='', file=c_file)
|
||||
|
||||
Reference in New Issue
Block a user