Skip to content
Myr

sanity checks upon boot

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent de035b5 · Browse files · 1 file+25 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+25 added−0 removed

  • other:+25 added−0 removed

1 file+25 added−0 removed

modified:requests/__init__.py+25 added
42 unmodified lines
43from .__version__ import __title__, __description__, __url__, __version__44from .__version__ import __build__, __author__, __author_email__, __license__45from .__version__ import __copyright__, __cake__4647# Check urllib3 for compatibility.48import urllib349major, minor, patch = urllib3.__version__.split('.')[:3]50major, minor, patch = int(major), int(minor), int(patch)51# urllib3 >= 1.21.1, < 1.2252try:53 assert major == 154 assert minor >= 2155 assert minor <= 2256except AssertionError:57 raise RuntimeError('Requests dependency \'urllib3\' must be version >= 1.21.1, < 1.22!')585960# Check chardet for compatibility.61import chardet62major, minor, patch = chardet.__version__.split('.')[:3]63major, minor, patch = int(major), int(minor), int(patch)64# chardet >= 3.0.2, < 3.1.065try:66 assert major == 367 assert minor < 168 assert patch >= 269except AssertionError:70 raise RuntimeError('Requests dependency \'chardet\' must be version >= 3.0.2, < 3.1.0!')7172# Attempt to enable urllib3's SNI support, if possible73try:74 from urllib3.contrib import pyopenssl75 pyopenssl.inject_into_urllib3()
33 unmodified lines