Skip to content

Commit c40bb72

Browse files
authored
requests.packages is deprecated, import from urllib3 (#10563)
1 parent ea14dd5 commit c40bb72

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

sphinx/util/requests.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,11 @@
77
from urllib.parse import urlsplit
88

99
import requests
10+
from urllib3.exceptions import InsecureRequestWarning
1011

1112
import sphinx
1213
from sphinx.config import Config
1314

14-
try:
15-
from requests.packages.urllib3.exceptions import InsecureRequestWarning
16-
except ImportError:
17-
try:
18-
# for Debian-jessie
19-
from urllib3.exceptions import InsecureRequestWarning
20-
except ImportError:
21-
# for requests < 2.4.0
22-
InsecureRequestWarning = None
23-
24-
2515
useragent_header = [('User-Agent',
2616
'Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0')]
2717

0 commit comments

Comments
 (0)