mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 02:54:34 +02:00
simplify code (#9807)
This commit is contained in:
@@ -47,15 +47,8 @@ ECDSA_KEY_TYPE = 'ecdsa'
|
|||||||
|
|
||||||
|
|
||||||
def _suppress_x509_verification_warnings() -> None:
|
def _suppress_x509_verification_warnings() -> None:
|
||||||
try:
|
import urllib3
|
||||||
import urllib3
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
||||||
except ImportError:
|
|
||||||
# Handle old versions of request with vendorized urllib3
|
|
||||||
# pylint: disable=no-member,line-too-long
|
|
||||||
from requests.packages.urllib3.exceptions import InsecureRequestWarning # type: ignore[import-untyped]
|
|
||||||
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) # type: ignore[attr-defined]
|
|
||||||
# pylint: enable=no-member,line-too-long
|
|
||||||
|
|
||||||
|
|
||||||
def check_until_timeout(url: str, attempts: int = 30) -> None:
|
def check_until_timeout(url: str, attempts: int = 30) -> None:
|
||||||
|
|||||||
+3
-1
@@ -19,7 +19,9 @@ install_requires = [
|
|||||||
'pywin32>=300 ; sys_platform == "win32"',
|
'pywin32>=300 ; sys_platform == "win32"',
|
||||||
'pyyaml',
|
'pyyaml',
|
||||||
'pytz>=2019.3',
|
'pytz>=2019.3',
|
||||||
'requests',
|
# requests unvendored its dependencies in version 2.16.0 and this code relies on that for
|
||||||
|
# calling `urllib3.disable_warnings`.
|
||||||
|
'requests>=2.16.0',
|
||||||
'setuptools',
|
'setuptools',
|
||||||
'types-python-dateutil',
|
'types-python-dateutil',
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user