summaryrefslogtreecommitdiffstatshomepage
path: root/shared/memzip/make-memzip.py
diff options
context:
space:
mode:
authorChristian Clauss <cclauss@me.com>2023-03-10 05:59:28 +0100
committerDamien George <damien@micropython.org>2023-05-02 16:14:45 +1000
commit79e57473b20707ca948920fbce473d64dbd8ce25 (patch)
tree01425c0ea0c9ec929b0dd9d2fb7d87680be18a60 /shared/memzip/make-memzip.py
parent8f8bd981641e0988b9ed3276c8f2435645269b3f (diff)
downloadmicropython-79e57473b20707ca948920fbce473d64dbd8ce25.tar.gz
micropython-79e57473b20707ca948920fbce473d64dbd8ce25.zip
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`.
Diffstat (limited to 'shared/memzip/make-memzip.py')
-rwxr-xr-xshared/memzip/make-memzip.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/shared/memzip/make-memzip.py b/shared/memzip/make-memzip.py
index 9730f5e008..cc0df82077 100755
--- a/shared/memzip/make-memzip.py
+++ b/shared/memzip/make-memzip.py
@@ -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)