diff --git a/lib/ansible/galaxy/collection/__init__.py b/lib/ansible/galaxy/collection/__init__.py index 114ec322d9d..2e6565d5ffd 100644 --- a/lib/ansible/galaxy/collection/__init__.py +++ b/lib/ansible/galaxy/collection/__init__.py @@ -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, diff --git a/lib/ansible/galaxy/collection/concrete_artifact_manager.py b/lib/ansible/galaxy/collection/concrete_artifact_manager.py index 5e46b1764d0..bdc2b9c4c3b 100644 --- a/lib/ansible/galaxy/collection/concrete_artifact_manager.py +++ b/lib/ansible/galaxy/collection/concrete_artifact_manager.py @@ -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( diff --git a/lib/ansible/utils/collection_loader/_collection_finder.py b/lib/ansible/utils/collection_loader/_collection_finder.py index 7d54fcf7ed8..875cbe90665 100644 --- a/lib/ansible/utils/collection_loader/_collection_finder.py +++ b/lib/ansible/utils/collection_loader/_collection_finder.py @@ -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')