Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4c7108a7
Commit
4c7108a7
authored
Feb 19, 2018
by
pmp-p
Committed by
Zachary Ware
Feb 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-32682: Improve libz version parsing in test_zilb (GH-5347)
parent
dfa015cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
Lib/test/test_zlib.py
Lib/test/test_zlib.py
+9
-4
No files found.
Lib/test/test_zlib.py
View file @
4c7108a7
...
...
@@ -751,10 +751,15 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
def
test_wbits
(
self
):
# wbits=0 only supported since zlib v1.2.3.5
# Register "1.2.3" as "1.2.3.0"
v
=
(
zlib
.
ZLIB_RUNTIME_VERSION
+
".0"
).
split
(
"."
,
4
)
supports_wbits_0
=
int
(
v
[
0
])
>
1
or
int
(
v
[
0
])
==
1
\
and
(
int
(
v
[
1
])
>
2
or
int
(
v
[
1
])
==
2
and
(
int
(
v
[
2
])
>
3
or
int
(
v
[
2
])
==
3
and
int
(
v
[
3
])
>=
5
))
# or "1.2.0-linux","1.2.0.f","1.2.0.f-linux"
v
=
zlib
.
ZLIB_RUNTIME_VERSION
.
split
(
'-'
,
1
)[
0
].
split
(
'.'
)
if
len
(
v
)
<
4
:
v
.
append
(
'0'
)
elif
not
v
[
-
1
].
isnumeric
():
v
[
-
1
]
=
'0'
v
=
tuple
(
map
(
int
,
v
))
supports_wbits_0
=
v
>=
(
1
,
2
,
3
,
5
)
co
=
zlib
.
compressobj
(
level
=
1
,
wbits
=
15
)
zlib15
=
co
.
compress
(
HAMLET_SCENE
)
+
co
.
flush
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment