Skip to content

Commit b67aea1

Browse files
committed
_retry(): type-hints added
Change-Id: Ifbc702ccfae3e16cb513cb581582ac042757a56f
1 parent eb74b3a commit b67aea1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

python/src/etos_api/library/docker.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import logging
2020
import time
2121
from threading import Lock
22-
from typing import Mapping, Optional
22+
from typing import Any, Awaitable, Callable, Mapping, Optional
2323

2424
import aiohttp
2525

@@ -244,7 +244,12 @@ async def digest(self, name: str) -> Optional[str]:
244244
manifest_url = f"https://{registry}/v2/{repo}/manifests/{tag}"
245245
return await self._retry(self._get_digest, name, manifest_url)
246246

247-
async def _retry(self, func, name: str, *args) -> Optional[str]:
247+
async def _retry(
248+
self,
249+
func: Callable[..., Awaitable[Optional[str]]],
250+
name: str,
251+
*args: Any,
252+
) -> Optional[str]:
248253
"""Call *func* with retries and exponential backoff.
249254
250255
Retries on transient connection errors (e.g. DNS hiccups) up to

0 commit comments

Comments
 (0)