mirror of
https://github.com/certbot/certbot.git
synced 2026-01-26 07:41:33 +03:00
simplify code (#9807)
This commit is contained in:
@@ -47,15 +47,8 @@ ECDSA_KEY_TYPE = 'ecdsa'
|
||||
|
||||
|
||||
def _suppress_x509_verification_warnings() -> None:
|
||||
try:
|
||||
import urllib3
|
||||
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
|
||||
import urllib3
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
|
||||
def check_until_timeout(url: str, attempts: int = 30) -> None:
|
||||
|
||||
@@ -19,7 +19,9 @@ install_requires = [
|
||||
'pywin32>=300 ; sys_platform == "win32"',
|
||||
'pyyaml',
|
||||
'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',
|
||||
'types-python-dateutil',
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user