From 0604d6a2c9cd6ac0c86baeda436abed06638d374 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 6 Feb 2026 21:12:31 +1100 Subject: [PATCH] Remove unused argument --- Tests/test_font_pcf.py | 6 +++--- src/PIL/FontFile.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/test_font_pcf.py b/Tests/test_font_pcf.py index 01d56dfd3..8ac63ea61 100644 --- a/Tests/test_font_pcf.py +++ b/Tests/test_font_pcf.py @@ -75,13 +75,13 @@ def test_draw(request: pytest.FixtureRequest, tmp_path: Path) -> None: assert_image_equal_tofile(im, "Tests/images/test_draw_pbm_target.png") -def test_to_imagefont(request: pytest.FixtureRequest, tmp_path: Path) -> None: +def test_to_imagefont(tmp_path: Path) -> None: with open(fontname, "rb") as test_file: pcffont = PcfFontFile.PcfFontFile(test_file) - imgfont = pcffont.to_imagefont() + imagefont = pcffont.to_imagefont() im = Image.new("L", (130, 30), "white") draw = ImageDraw.Draw(im) - draw.text((0, 0), message, "black", font=imgfont) + draw.text((0, 0), message, "black", font=imagefont) assert_image_equal_tofile(im, "Tests/images/test_draw_pbm_target.png") diff --git a/src/PIL/FontFile.py b/src/PIL/FontFile.py index b50385daa..71a08b05e 100644 --- a/src/PIL/FontFile.py +++ b/src/PIL/FontFile.py @@ -151,6 +151,6 @@ class FontFile: buf = io.BytesIO() self.save_metrics(buf) buf.seek(0) - imgfont = ImageFont.ImageFont() - imgfont._load_pilfont_data(buf, self.bitmap) - return imgfont + imagefont = ImageFont.ImageFont() + imagefont._load_pilfont_data(buf, self.bitmap) + return imagefont