From dc264da15cf1c7313e13966684e6eb9b7a1537f8 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 24 Apr 2024 18:08:53 +1000 Subject: [PATCH] Accept '.zlib-ng' suffix to zlib version --- Tests/test_features.py | 2 ++ Tests/test_file_png.py | 2 +- 2 files changed, 3 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..c34a3cd22f8 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -85,7 +85,7 @@ 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")