Fix #3268: Sphinx crashes with requests package from Debian jessie

This commit is contained in:
Takeshi KOMIYA 2017-01-07 14:29:19 +09:00
parent 70cdc7be8f
commit 62329c82f6
2 changed files with 7 additions and 1 deletions

View File

@ -26,6 +26,7 @@ Bugs fixed
* The warning type ``misc.highlighting_failure`` does not work
* #3294: ``add_latex_package()`` make crashes non-LaTeX builders
* The caption of table are rendered as invalid HTML (refs: #3287)
* #3268: Sphinx crashes with requests package from Debian jessie
Release 1.5.1 (released Dec 13, 2016)

View File

@ -17,7 +17,12 @@ import pkg_resources
from six import string_types
from six.moves.urllib.parse import urlsplit
from requests.packages.urllib3.exceptions import SSLError, InsecureRequestWarning
try:
from requests.packages.urllib3.exceptions import SSLError, InsecureRequestWarning
except ImportError:
# python-requests package in Debian jessie does not provide ``requests.packages.urllib3``.
# So try to import the exceptions from urllib3 package.
from urllib3.exceptions import SSLError, InsecureRequestWarning
# try to load requests[security]
try: