mirror of https://github.com/MISP/PyMISP
fix: urllib3.__version__ may not have a patch number
fix https://github.com/MISP/PyMISP/issues/698pull/749/head
parent
5035911d45
commit
59bb0a7bb6
|
@ -95,7 +95,12 @@ def brotli_supported() -> bool:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# urllib >= 1.25.1 includes brotli support
|
# urllib >= 1.25.1 includes brotli support
|
||||||
major, minor, patch = urllib3.__version__.split('.') # noqa: F811
|
version_splitted = urllib3.__version__.split('.') # noqa: F811
|
||||||
|
if len(version_splitted) == 2:
|
||||||
|
major, minor = version_splitted
|
||||||
|
patch = 0
|
||||||
|
else:
|
||||||
|
major, minor, patch = version_splitted
|
||||||
major, minor, patch = int(major), int(minor), int(patch)
|
major, minor, patch = int(major), int(minor), int(patch)
|
||||||
urllib3_with_brotli = (major == 1 and ((minor == 25 and patch >= 1) or (minor >= 26))) or major >= 2
|
urllib3_with_brotli = (major == 1 and ((minor == 25 and patch >= 1) or (minor >= 26))) or major >= 2
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue