diff --git a/core/testcontainers/core/docker_client.py b/core/testcontainers/core/docker_client.py index 674b2ed6..418a842f 100644 --- a/core/testcontainers/core/docker_client.py +++ b/core/testcontainers/core/docker_client.py @@ -215,7 +215,7 @@ def client_networks_create(self, name: str, param: dict): labels = create_labels("", param.get("labels")) return self.client.networks.create(name, **{**param, "labels": labels}) - def find_container_by_hash(self, hash_: str) -> Container | None: + def find_container_by_hash(self, hash_: str) -> Union[Container, None]: for container in self.client.containers.list(all=True): if container.labels.get("hash", None) == hash_: return container