mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-02 20:30:30 -06:00
Remove warnings for old python which does not support SNI
This commit is contained in:
1 parent
66fad4e22d
commit
77e0139a26
1 file changed
+2
-12
+2
-12
@@ -47,7 +47,7 @@ except ImportError:
|
|||||||
|
|
||||||
# try to load requests[security] (but only if SSL is available)
|
# try to load requests[security] (but only if SSL is available)
|
||||||
try:
|
try:
|
||||||
import ssl
|
import ssl # NOQA
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
@@ -55,17 +55,7 @@ else:
|
|||||||
pkg_resources.require(['requests[security]'])
|
pkg_resources.require(['requests[security]'])
|
||||||
except (pkg_resources.DistributionNotFound,
|
except (pkg_resources.DistributionNotFound,
|
||||||
pkg_resources.VersionConflict):
|
pkg_resources.VersionConflict):
|
||||||
if not getattr(ssl, 'HAS_SNI', False):
|
pass # ignored
|
||||||
# don't complain on each url processed about the SSL issue
|
|
||||||
if InsecurePlatformWarning:
|
|
||||||
requests.packages.urllib3.disable_warnings(InsecurePlatformWarning)
|
|
||||||
warnings.warn(
|
|
||||||
'Some links may return broken results due to being unable to '
|
|
||||||
'check the Server Name Indication (SNI) in the returned SSL cert '
|
|
||||||
'against the hostname in the url requested. Recommended to '
|
|
||||||
'install "requests[security]" as a dependency or upgrade to '
|
|
||||||
'a python version with SNI support (Python 3 and Python 2.7.9+).'
|
|
||||||
)
|
|
||||||
except pkg_resources.UnknownExtra:
|
except pkg_resources.UnknownExtra:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
'Some links may return broken results due to being unable to '
|
'Some links may return broken results due to being unable to '
|
||||||
|
|||||||
Reference in new issue
Block a user