diff --git a/podman/domain/images_manager.py b/podman/domain/images_manager.py index 985213fe..794268b8 100644 --- a/podman/domain/images_manager.py +++ b/podman/domain/images_manager.py @@ -32,6 +32,8 @@ logger = logging.getLogger("podman.images") +type builtin_list = list + class ImagesManager(BuildMixin, Manager): """Specialized Manager for Image resources.""" @@ -287,7 +289,7 @@ def push( @staticmethod def _push_helper( - decode: bool, body: list[dict[str, Any]] + decode: bool, body: builtin_list[dict[str, Any]] ) -> Iterator[Union[str, dict[str, Any]]]: """Helper needed to allow push() to return either a generator or a str.""" for entry in body: @@ -303,7 +305,7 @@ def pull( tag: Optional[str] = None, all_tags: bool = False, **kwargs, - ) -> Union[Image, list[Image], Iterator[str]]: + ) -> Union[Image, builtin_list[Image], Iterator[str]]: """Request Podman service to pull image(s) from repository. Args: @@ -446,7 +448,7 @@ def remove( image: Union[Image, str], force: Optional[bool] = None, noprune: bool = False, # pylint: disable=unused-argument - ) -> list[dict[Literal["Deleted", "Untagged", "Errors", "ExitCode"], Union[str, int]]]: + ) -> builtin_list[dict[Literal["Deleted", "Untagged", "Errors", "ExitCode"], Union[str, int]]]: """Delete image from Podman service. Args: @@ -473,7 +475,7 @@ def remove( results.append({"ExitCode": body["ExitCode"]}) return results - def search(self, term: str, **kwargs) -> list[dict[str, Any]]: + def search(self, term: str, **kwargs) -> builtin_list[dict[str, Any]]: """Search Images on registries. Args: diff --git a/podman/domain/pods_manager.py b/podman/domain/pods_manager.py index 9b398a6d..b79c871d 100644 --- a/podman/domain/pods_manager.py +++ b/podman/domain/pods_manager.py @@ -11,6 +11,8 @@ logger = logging.getLogger("podman.pods") +type builtin_list = list + class PodsManager(Manager): """Specialized Manager for Pod resources.""" @@ -129,7 +131,7 @@ def remove(self, pod_id: Union[Pod, str], force: Optional[bool] = None) -> None: response = self.client.delete(f"/pods/{pod_id}", params={"force": force}) response.raise_for_status() - def stats(self, **kwargs) -> list[dict[str, Any]] | [list[dict[str, Any]]]: + def stats(self, **kwargs) -> builtin_list[dict[str, Any]] | [builtin_list[dict[str, Any]]]: """Resource usage statistics for the containers in pods. Keyword Args: