Skip to content

Commit

Permalink
Add noqas for UP031
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Nov 3, 2023
1 parent 93c8201 commit f3b16b1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Tests/bench_cffi_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/EpsImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/IcnsImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/PIL/PdfParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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:
Expand Down

0 comments on commit f3b16b1

Please sign in to comment.