From 9e615b6ad38d1f20e0ad61ed9334f224a4030ce4 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Mon, 30 Oct 2023 20:04:44 +0200 Subject: [PATCH] Add noqas for UP031 --- Tests/bench_cffi_access.py | 2 +- src/PIL/EpsImagePlugin.py | 2 +- src/PIL/IcnsImagePlugin.py | 2 +- src/PIL/Image.py | 2 +- src/PIL/PdfParser.py | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/bench_cffi_access.py b/Tests/bench_cffi_access.py index 69ebef9b458..d94b1985b17 100644 --- a/Tests/bench_cffi_access.py +++ b/Tests/bench_cffi_access.py @@ -45,7 +45,7 @@ def test_direct(): assert caccess[(0, 0)] == access[(0, 0)] - print("Size: %sx%s" % im.size) + print("Size: %sx%s" % im.size) # noqa: UP031 timer(iterate_get, "PyAccess - get", im.size, access) timer(iterate_set, "PyAccess - set", im.size, access) timer(iterate_get, "C-api - get", im.size, caccess) diff --git a/src/PIL/EpsImagePlugin.py b/src/PIL/EpsImagePlugin.py index 9b2fce0ac01..63369eb64f1 100644 --- a/src/PIL/EpsImagePlugin.py +++ b/src/PIL/EpsImagePlugin.py @@ -122,7 +122,7 @@ def Ghostscript(tile, size, fp, scale=1, transparency=False): gs_binary, "-q", # quiet mode "-g%dx%d" % size, # set output geometry (pixels) - "-r%fx%f" % res, # set input DPI (dots per inch) + "-r%fx%f" % res, # set input DPI (dots per inch) # noqa: UP031 "-dBATCH", # exit after processing "-dNOPAUSE", # don't pause between pages "-dSAFER", # safe mode diff --git a/src/PIL/IcnsImagePlugin.py b/src/PIL/IcnsImagePlugin.py index 0aa4f7a8458..5226c986d61 100644 --- a/src/PIL/IcnsImagePlugin.py +++ b/src/PIL/IcnsImagePlugin.py @@ -392,7 +392,7 @@ def _accept(prefix): imf = IcnsImageFile(fp) for size in imf.info["sizes"]: imf.size = size - imf.save("out-%s-%s-%s.png" % size) + imf.save("out-%s-%s-%s.png" % size) # noqa: UP031 with Image.open(sys.argv[1]) as im: im.save("out.png") if sys.platform == "windows": diff --git a/src/PIL/Image.py b/src/PIL/Image.py index cb092f1ae1f..930ca060bb1 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -3100,7 +3100,7 @@ def fromarray(obj, mode=None): try: mode, rawmode = _fromarray_typemap[typekey] except KeyError as e: - msg = "Cannot handle this data type: %s, %s" % typekey + msg = "Cannot handle this data type: %s, %s" % typekey # noqa: UP031 raise TypeError(msg) from e else: rawmode = mode diff --git a/src/PIL/PdfParser.py b/src/PIL/PdfParser.py index dc1012f54d3..07df577ae6d 100644 --- a/src/PIL/PdfParser.py +++ b/src/PIL/PdfParser.py @@ -82,7 +82,7 @@ class IndirectReference( collections.namedtuple("IndirectReferenceTuple", ["object_id", "generation"]) ): def __str__(self): - return "%s %s R" % self + return "%s %s R" % self # noqa: UP031 def __bytes__(self): return self.__str__().encode("us-ascii") @@ -103,7 +103,7 @@ def __hash__(self): class IndirectObjectDef(IndirectReference): def __str__(self): - return "%s %s obj" % self + return "%s %s obj" % self # noqa: UP031 class XrefTable: