Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Lib/test/test_zlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,14 @@ def test_flushes(self):
sync_opt = ['Z_NO_FLUSH', 'Z_SYNC_FLUSH', 'Z_FULL_FLUSH',
'Z_PARTIAL_FLUSH']

ver = tuple(int(v) for v in zlib.ZLIB_RUNTIME_VERSION.split('.'))
v = zlib.ZLIB_RUNTIME_VERSION.split('-', 1)[0].split('.')
if len(v) < 4:
v.append('0')
elif not v[-1].isnumeric():
v[-1] = '0'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 5 lines appear also in test_wbits, wouldn't it be better to extract them into a helper function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe, i'll have a look if i or someone make an android buildbot someday and/or have some time left and testsuite can actually run.

ver = tuple(map(int, v))

# Z_BLOCK has a known failure prior to 1.2.5.3
if ver >= (1, 2, 5, 3):
sync_opt.append('Z_BLOCK')
Expand Down