Skip to content

Commit

Permalink
Merge pull request #1747 from girder/update-type-annotation
Browse files Browse the repository at this point in the history
Update a type annotation
  • Loading branch information
manthey authored Dec 30, 2024
2 parents 0e6db1f + 18cf906 commit 20c5cc9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions large_image/cache_util/cachefactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import math
import threading
from importlib.metadata import entry_points
from typing import Dict, Optional, Tuple, Type
from typing import Dict, Optional, Tuple, Type, cast

import cachetools

Expand Down Expand Up @@ -95,7 +95,7 @@ def pickAvailableCache(
return numItems


def getFirstAvailableCache() -> Tuple[cachetools.Cache, Optional[threading.Lock]]:
def getFirstAvailableCache() -> Tuple[Optional[cachetools.Cache], Optional[threading.Lock]]:
cacheBackend = config.getConfig('cache_backend', None)
if cacheBackend is not None:
msg = 'cache_backend already set'
Expand All @@ -104,7 +104,9 @@ def getFirstAvailableCache() -> Tuple[cachetools.Cache, Optional[threading.Lock]
cache, cacheLock = None, None
for cacheBackend in _availableCaches:
try:
cache, cacheLock = _availableCaches[cacheBackend].getCache() # type: ignore
cache, cacheLock = cast(
Tuple[cachetools.Cache, Optional[threading.Lock]],
_availableCaches[cacheBackend].getCache()) # type: ignore
break
except TileCacheError:
continue
Expand Down

0 comments on commit 20c5cc9

Please sign in to comment.