Skip to content

Commit ed910a6

Browse files
radarherenulano
authored andcommitted
Only replace version suffix if zlib-ng is present
1 parent c07e089 commit ed910a6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Tests/test_features.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ def test(name: str, function: Callable[[str], str | None]) -> None:
3636
else:
3737
assert function(name) == version
3838
if name != "PIL":
39-
if name == "zlib" and version is not None:
40-
version = re.sub(".zlib-ng$", "", version)
41-
elif name == "libtiff" and version is not None:
42-
version = re.sub("t$", "", version)
39+
if version is not None:
40+
if name == "zlib" and features.check_feature("zlib_ng"):
41+
version = re.sub(".zlib-ng$", "", version)
42+
elif name == "libtiff":
43+
version = re.sub("t$", "", version)
4344
assert version is None or re.search(r"\d+(\.\d+)*$", version)
4445

4546
for module in features.modules:

0 commit comments

Comments
 (0)