We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 128192c commit a6ddf46Copy full SHA for a6ddf46
Lib/test/test_zlib.py
@@ -30,6 +30,20 @@ def _zlib_runtime_version_tuple(zlib_version=zlib.ZLIB_RUNTIME_VERSION):
30
ZLIB_RUNTIME_VERSION_TUPLE = _zlib_runtime_version_tuple()
31
32
33
+def _zlib_runtime_version_tuple(zlib_version=zlib.ZLIB_RUNTIME_VERSION):
34
+ # Register "1.2.3" as "1.2.3.0"
35
+ # or "1.2.0-linux","1.2.0.f","1.2.0.f-linux"
36
+ v = zlib_version.split('-', 1)[0].split('.')
37
+ if len(v) < 4:
38
+ v.append('0')
39
+ elif not v[-1].isnumeric():
40
+ v[-1] = '0'
41
+ return tuple(map(int, v))
42
+
43
44
+ZLIB_RUNTIME_VERSION_TUPLE = _zlib_runtime_version_tuple()
45
46
47
class VersionTestCase(unittest.TestCase):
48
49
def test_library_version(self):
0 commit comments