From 4f545b3e147ed6e35bdff7ab84ca9aeafa7243cf Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 24 Apr 2024 18:21:30 +1000 Subject: [PATCH] Accept '.zlib-ng' suffix to zlib version --- Tests/test_features.py | 2 ++ Tests/test_file_png.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Tests/test_features.py b/Tests/test_features.py index 3a528a7c8c6..2d402ca9114 100644 --- a/Tests/test_features.py +++ b/Tests/test_features.py @@ -37,6 +37,8 @@ def test(name: str, function: Callable[[str], bool]) -> None: else: assert function(name) == version if name != "PIL": + if name == "zlib" and version is not None: + version = version.replace(".zlib-ng", "") assert version is None or re.search(r"\d+(\.\d+)*$", version) for module in features.modules: diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index 30fb14c44c4..19462dcb5a4 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -85,7 +85,9 @@ def get_chunks(self, filename: str) -> list[bytes]: def test_sanity(self, tmp_path: Path) -> None: # internal version number - assert re.search(r"\d+(\.\d+){1,3}$", features.version_codec("zlib")) + assert re.search( + r"\d+(\.\d+){1,3}(\.zlib\-ng)?$", features.version_codec("zlib") + ) test_file = str(tmp_path / "temp.png")