File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919import math
2020import threading
2121from abc import ABC , abstractmethod
22- from collections .abc import Iterator
22+ from collections .abc import Iterator , MutableMapping
2323from copy import copy
2424from enum import Enum
2525from types import TracebackType
@@ -898,14 +898,12 @@ def __hash__(self) -> int:
898898_DEFAULT_MANIFEST_CACHE_SIZE = 128
899899_configured_manifest_cache_size = Config ().get_int ("manifest-cache-size" )
900900_manifest_cache_size = (
901- _configured_manifest_cache_size if _configured_manifest_cache_size is not None else _DEFAULT_MANIFEST_CACHE_SIZE
901+ max ( _configured_manifest_cache_size , 0 ) if _configured_manifest_cache_size is not None else _DEFAULT_MANIFEST_CACHE_SIZE
902902)
903903
904- # Lock for thread-safe cache access.
904+ # Lock for thread-safe cache access
905905_manifest_cache_lock = threading .RLock ()
906- _manifest_cache : LRUCache [str , ManifestFile ] | dict [str , ManifestFile ] = (
907- LRUCache (maxsize = _manifest_cache_size ) if _manifest_cache_size > 0 else {}
908- )
906+ _manifest_cache : MutableMapping [str , ManifestFile ] = LRUCache (maxsize = _manifest_cache_size ) if _manifest_cache_size > 0 else {}
909907
910908
911909def clear_manifest_cache () -> None :
You can’t perform that action at this time.
0 commit comments