Add noqas for UP031

This commit is contained in:
Aarni Koskela 2023-10-30 20:04:44 +02:00
parent 307d00b44d
commit 9e615b6ad3
5 changed files with 6 additions and 6 deletions

View File

@ -45,7 +45,7 @@ def test_direct():
assert caccess[(0, 0)] == access[(0, 0)] 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_get, "PyAccess - get", im.size, access)
timer(iterate_set, "PyAccess - set", im.size, access) timer(iterate_set, "PyAccess - set", im.size, access)
timer(iterate_get, "C-api - get", im.size, caccess) timer(iterate_get, "C-api - get", im.size, caccess)

View File

@ -122,7 +122,7 @@ def Ghostscript(tile, size, fp, scale=1, transparency=False):
gs_binary, gs_binary,
"-q", # quiet mode "-q", # quiet mode
"-g%dx%d" % size, # set output geometry (pixels) "-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 "-dBATCH", # exit after processing
"-dNOPAUSE", # don't pause between pages "-dNOPAUSE", # don't pause between pages
"-dSAFER", # safe mode "-dSAFER", # safe mode

View File

@ -392,7 +392,7 @@ if __name__ == "__main__":
imf = IcnsImageFile(fp) imf = IcnsImageFile(fp)
for size in imf.info["sizes"]: for size in imf.info["sizes"]:
imf.size = size 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: with Image.open(sys.argv[1]) as im:
im.save("out.png") im.save("out.png")
if sys.platform == "windows": if sys.platform == "windows":

View File

@ -3100,7 +3100,7 @@ def fromarray(obj, mode=None):
try: try:
mode, rawmode = _fromarray_typemap[typekey] mode, rawmode = _fromarray_typemap[typekey]
except KeyError as e: 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 raise TypeError(msg) from e
else: else:
rawmode = mode rawmode = mode

View File

@ -82,7 +82,7 @@ class IndirectReference(
collections.namedtuple("IndirectReferenceTuple", ["object_id", "generation"]) collections.namedtuple("IndirectReferenceTuple", ["object_id", "generation"])
): ):
def __str__(self): def __str__(self):
return "%s %s R" % self return "%s %s R" % self # noqa: UP031
def __bytes__(self): def __bytes__(self):
return self.__str__().encode("us-ascii") return self.__str__().encode("us-ascii")
@ -103,7 +103,7 @@ class IndirectReference(
class IndirectObjectDef(IndirectReference): class IndirectObjectDef(IndirectReference):
def __str__(self): def __str__(self):
return "%s %s obj" % self return "%s %s obj" % self # noqa: UP031
class XrefTable: class XrefTable: