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:
Christian Clauss
2023-03-10 05:59:28 +01:00
committed by Damien George
parent 8f8bd98164
commit 79e57473b2
4 changed files with 4 additions and 4 deletions

View File

@@ -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)