Fix imports. (#585)

This commit is contained in:
Felix Fontein 2023-02-12 22:09:02 +01:00 committed by GitHub
parent 449b91d489
commit a426232523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -21,9 +21,9 @@ BACKPORTS_SSL_MATCH_HOSTNAME_IMPORT_ERROR = None
try:
from requests import Session
from requests.adapters import HTTPAdapter
from requests.exceptions import HTTPError, InvalidSchema
from requests import Session # noqa: F401, pylint: disable=unused-import
from requests.adapters import HTTPAdapter # noqa: F401, pylint: disable=unused-import
from requests.exceptions import HTTPError, InvalidSchema # noqa: F401, pylint: disable=unused-import
except ImportError:
REQUESTS_IMPORT_ERROR = traceback.format_exc()

View File

@ -67,7 +67,7 @@ except ImportError:
try:
from requests.exceptions import RequestException
from requests.exceptions import RequestException # noqa: F401, pylint: disable=unused-import
except ImportError:
# Either Docker SDK for Python is no longer using requests, or Docker SDK for Python isn't around either,
# or Docker SDK for Python's dependency requests is missing. In any case, define an exception

View File

@ -19,7 +19,7 @@ from ansible.module_utils.parsing.convert_bool import BOOLEANS_TRUE, BOOLEANS_FA
from ansible_collections.community.docker.plugins.module_utils.version import LooseVersion
try:
from requests.exceptions import RequestException, SSLError
from requests.exceptions import RequestException, SSLError # noqa: F401, pylint: disable=unused-import
except ImportError:
# Define an exception class RequestException so that our code doesn't break.
class RequestException(Exception):