Skip to content

Commit f937f1e

Browse files
committed
Accept '.zlib-ng' suffix to zlib version
1 parent 41270f3 commit f937f1e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Tests/test_features.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def test(name: str, function: Callable[[str], bool]) -> None:
3737
else:
3838
assert function(name) == version
3939
if name != "PIL":
40+
if name == "zlib" and version is not None:
41+
version = version.replace(".zlib-ng", "")
4042
assert version is None or re.search(r"\d+(\.\d+)*$", version)
4143

4244
for module in features.modules:

Tests/test_file_png.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def get_chunks(self, filename: str) -> list[bytes]:
8585

8686
def test_sanity(self, tmp_path: Path) -> None:
8787
# internal version number
88-
assert re.search(r"\d+(\.\d+){1,3}$", features.version_codec("zlib"))
88+
assert re.search(
89+
r"\d+(\.\d+){1,3}(\.zlib\-ng)?$", features.version_codec("zlib")
90+
)
8991

9092
test_file = str(tmp_path / "temp.png")
9193

0 commit comments

Comments
 (0)