Skip to content

Commit c270013

Browse files
committed
noqa exclude for f-string repr usage
1 parent 7469a78 commit c270013

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_imageload/pnm/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ def load( # noqa: PLR0912 Too many branches
124124

125125
next_byte = file.read(1)
126126
if next_byte == b"":
127-
raise RuntimeError(f"Unsupported image format {magic_number!r}")
127+
# mpy-cross does not support !r in f-string substitution, so ignore ruff rule
128+
raise RuntimeError("Unsupported image format {!r}".format(magic_number)) # noqa: UP032, f-string
128129
if next_byte == b"#": # comment found, seek until a newline or EOF is found
129130
while file.read(1) not in [b"", b"\n"]: # EOF or NL
130131
pass

0 commit comments

Comments
 (0)