Skip to content

Commit

Permalink
Allow charset normalizer >=2 and <4 (#6261)
Browse files Browse the repository at this point in the history
  • Loading branch information
deedy5 committed Oct 20, 2022
1 parent 7104ad4 commit c57f1f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions requests/__init__.py
Expand Up @@ -80,8 +80,8 @@ def check_compatibility(urllib3_version, chardet_version, charset_normalizer_ver
elif charset_normalizer_version:
major, minor, patch = charset_normalizer_version.split(".")[:3]
major, minor, patch = int(major), int(minor), int(patch)
# charset_normalizer >= 2.0.0 < 3.0.0
assert (2, 0, 0) <= (major, minor, patch) < (3, 0, 0)
# charset_normalizer >= 2.0.0 < 4.0.0
assert (2, 0, 0) <= (major, minor, patch) < (4, 0, 0)
else:
raise Exception("You need either charset_normalizer or chardet installed")

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -5,7 +5,7 @@ provides-extra =
use_chardet_on_py3
requires-dist =
certifi>=2017.4.17
charset_normalizer>=2,<3
charset_normalizer>=2,<4
idna>=2.5,<4
urllib3>=1.21.1,<1.27

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -59,7 +59,7 @@ def run_tests(self):
sys.exit()

requires = [
"charset_normalizer>=2,<3",
"charset_normalizer>=2,<4",
"idna>=2.5,<4",
"urllib3>=1.21.1,<1.27",
"certifi>=2017.4.17",
Expand Down

0 comments on commit c57f1f0

Please sign in to comment.