Only replace version suffix if zlib-ng is present

This commit is contained in:
Andrew Murray 2024-10-26 11:42:35 +11:00 committed by Ondrej Baranovič
parent c07e089fd1
commit ed910a68d6

View File

@ -36,9 +36,10 @@ def test_version() -> None:
else:
assert function(name) == version
if name != "PIL":
if name == "zlib" and version is not None:
if version is not None:
if name == "zlib" and features.check_feature("zlib_ng"):
version = re.sub(".zlib-ng$", "", version)
elif name == "libtiff" and version is not None:
elif name == "libtiff":
version = re.sub("t$", "", version)
assert version is None or re.search(r"\d+(\.\d+)*$", version)