mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #3554 from jdemeyer/allow_no_ssl
Allow running Sphinx without ssl
This commit is contained in:
commit
7a3f35e014
@ -36,12 +36,16 @@ except ImportError:
|
||||
# for requests < 2.4.0
|
||||
InsecureRequestWarning = None
|
||||
|
||||
# try to load requests[security]
|
||||
# try to load requests[security] (but only if SSL is available)
|
||||
try:
|
||||
import ssl
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
pkg_resources.require(['requests[security]'])
|
||||
except (pkg_resources.DistributionNotFound,
|
||||
pkg_resources.VersionConflict):
|
||||
import ssl
|
||||
if not getattr(ssl, 'HAS_SNI', False):
|
||||
# don't complain on each url processed about the SSL issue
|
||||
requests.packages.urllib3.disable_warnings(
|
||||
|
Loading…
Reference in New Issue
Block a user