diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-15 20:53:35 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-15 22:02:12 +0900 |
commit | 77e0139a26a080e5b7c0292ebd08fbb2eb540be9 (patch) | |
tree | 776691becc1b72f3b5a1b47a669de7d7b0675230 | |
parent | 66fad4e22debba321d0f334f8705b9c3e15b7173 (diff) | |
download | sphinx-git-77e0139a26a080e5b7c0292ebd08fbb2eb540be9.tar.gz |
Remove warnings for old python which does not support SNI
-rw-r--r-- | sphinx/util/requests.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sphinx/util/requests.py b/sphinx/util/requests.py index c19e05cec..88c19a021 100644 --- a/sphinx/util/requests.py +++ b/sphinx/util/requests.py @@ -47,7 +47,7 @@ except ImportError: # try to load requests[security] (but only if SSL is available) try: - import ssl + import ssl # NOQA except ImportError: pass else: @@ -55,17 +55,7 @@ else: pkg_resources.require(['requests[security]']) except (pkg_resources.DistributionNotFound, pkg_resources.VersionConflict): - if not getattr(ssl, 'HAS_SNI', False): - # 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+).' - ) + pass # ignored except pkg_resources.UnknownExtra: warnings.warn( 'Some links may return broken results due to being unable to ' |