From c40bb7281ec26c833aa7e0f792f063b2d2254ec7 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 17 Jun 2022 00:06:06 +0100 Subject: [PATCH] requests.packages is deprecated, import from urllib3 (#10563) --- sphinx/util/requests.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/sphinx/util/requests.py b/sphinx/util/requests.py index 62261934315..b25304d37ba 100644 --- a/sphinx/util/requests.py +++ b/sphinx/util/requests.py @@ -7,21 +7,11 @@ from urllib.parse import urlsplit import requests +from urllib3.exceptions import InsecureRequestWarning import sphinx from sphinx.config import Config -try: - from requests.packages.urllib3.exceptions import InsecureRequestWarning -except ImportError: - try: - # for Debian-jessie - from urllib3.exceptions import InsecureRequestWarning - except ImportError: - # for requests < 2.4.0 - InsecureRequestWarning = None - - useragent_header = [('User-Agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0')]