From d398fedb9d5af22316c715d2066176d15031d439 Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Sat, 1 Jul 2023 07:25:18 +1000 Subject: [PATCH] Added underscores for readability Co-authored-by: Hugo van Kemenade --- Tests/test_imagefont.py | 12 ++++++------ src/PIL/ImageFont.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index c50447a15..02622e721 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -1040,21 +1040,21 @@ def test_render_mono_size(): def test_too_many_characters(font): with pytest.raises(ValueError): - font.getlength("A" * 1000001) + font.getlength("A" * 1_000_001) with pytest.raises(ValueError): - font.getbbox("A" * 1000001) + font.getbbox("A" * 1_000_001) with pytest.raises(ValueError): - font.getmask2("A" * 1000001) + font.getmask2("A" * 1_000_001) transposed_font = ImageFont.TransposedFont(font) with pytest.raises(ValueError): - transposed_font.getlength("A" * 1000001) + transposed_font.getlength("A" * 1_000_001) default_font = ImageFont.load_default() with pytest.raises(ValueError): - default_font.getlength("A" * 1000001) + default_font.getlength("A" * 1_000_001) with pytest.raises(ValueError): - default_font.getbbox("A" * 1000001) + default_font.getbbox("A" * 1_000_001) @pytest.mark.parametrize( diff --git a/src/PIL/ImageFont.py b/src/PIL/ImageFont.py index 1030985eb..b7d40208c 100644 --- a/src/PIL/ImageFont.py +++ b/src/PIL/ImageFont.py @@ -41,7 +41,7 @@ class Layout(IntEnum): RAQM = 1 -MAX_STRING_LENGTH = 1000000 +MAX_STRING_LENGTH = 1_000_000 try: