Apply suggestions from code review

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Aarni Koskela 2023-11-13 09:28:01 +02:00 committed by GitHub
parent 126bc44e9e
commit f47633a24a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -391,8 +391,8 @@ if __name__ == "__main__":
with open(sys.argv[1], "rb") as fp:
imf = IcnsImageFile(fp)
for size in imf.info["sizes"]:
w, h, x = imf.size = size
imf.save(f"out-{w}-{h}-{x}.png")
width, height, scale = imf.size = size
imf.save(f"out-{width}-{height}-{scale}.png")
with Image.open(sys.argv[1]) as im:
im.save("out.png")
if sys.platform == "windows":

View File

@ -3100,8 +3100,8 @@ def fromarray(obj, mode=None):
try:
mode, rawmode = _fromarray_typemap[typekey]
except KeyError as e:
typ_shape, typ_type = typekey
msg = f"Cannot handle this data type: {typ_shape}, {typ_type}"
typekey_shape, typestr = typekey
msg = f"Cannot handle this data type: {typekey_shape}, {typestr}"
raise TypeError(msg) from e
else:
rawmode = mode