Code cleanup for type hinting issues.

pull/77229/head
Matt Clay 3 years ago
parent 8063643b4c
commit 4867ac217b

@ -1529,14 +1529,14 @@ def _resolve_depenency_map(
)
for req_inf in dep_exc.causes
)
error_msg_lines = chain(
error_msg_lines = list(chain(
(
'Failed to resolve the requested '
'dependencies map. Could not satisfy the following '
'requirements:',
),
conflict_causes,
)
))
raise raise_from( # NOTE: Leading "raise" is a hack for mypy bug #9717
AnsibleError('\n'.join(error_msg_lines)),
dep_exc,

@ -80,7 +80,7 @@ class ConcreteArtifactsManager:
server = collection.src.api_server
try:
download_url, _dummy, _dummy = self._galaxy_collection_cache[collection]
download_url = self._galaxy_collection_cache[collection][0]
signatures_url, signatures = self._galaxy_collection_origin_cache[collection]
except KeyError as key_err:
raise RuntimeError(

@ -71,10 +71,10 @@ try: # NOTE: py3/py2 compat
# py2 mypy can't deal with try/excepts
is_python_identifier = str.isidentifier # type: ignore[attr-defined]
except AttributeError: # Python 2
def is_python_identifier(tested_str): # type: (str) -> bool
def is_python_identifier(self): # type: (str) -> bool
"""Determine whether the given string is a Python identifier."""
# Ref: https://stackoverflow.com/a/55802320/595220
return bool(re.match(_VALID_IDENTIFIER_STRING_REGEX, tested_str))
return bool(re.match(_VALID_IDENTIFIER_STRING_REGEX, self))
PB_EXTENSIONS = ('.yml', '.yaml')

Loading…
Cancel
Save