diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index b697bbb6dee4..1e50be185b03 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -170,6 +170,10 @@ sys.ps1 # Available in interactive mode sys.ps2 # Available in interactive mode sys.tracebacklimit # Must be set first +# This is only present if Python was built with zlib-ng. +(zlib\.ZLIBNG_VERSION)? +(compression\.zlib\.ZLIBNG_VERSION)? + # ========================================================== # Other allowlist entries that cannot or should not be fixed diff --git a/stdlib/zlib.pyi b/stdlib/zlib.pyi index 4e410fdd18ad..d5998cab90fe 100644 --- a/stdlib/zlib.pyi +++ b/stdlib/zlib.pyi @@ -26,8 +26,8 @@ Z_RLE: Final = 3 Z_SYNC_FLUSH: Final = 2 Z_TREES: Final = 6 -if sys.version_info >= (3, 14) and sys.platform == "win32": - # Available when zlib was built with zlib-ng, usually only on Windows +if sys.version_info >= (3, 14): + # Available when zlib was built with zlib-ng ZLIBNG_VERSION: Final[str] class error(Exception): ...