check cache is not None

This commit is contained in:
Jimmy Lai 2019-12-12 16:22:59 -08:00
parent b8fd1a78e4
commit cd0252bbb9

View file

@ -49,7 +49,7 @@ class BaseMetadataProvider(MetadataDependent, Generic[_ProvidedMetadataT]):
def __init__(self, cache: object = None) -> None:
super().__init__()
self._computed = {}
if self.is_cache_required and not cache:
if self.is_cache_required and cache is not None:
# The metadata provider implementation is responsible to store and use cache.
raise Exception(
f"Cache is required for initializing {self.__class__.__name__}."