X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;ds=inline;f=persistent.py;fp=persistent.py;h=2751572553ac7c20c7663974c13e17b13f0ab037;hb=b454ad295eb3024a238d32bf2aef1ebc3c496b44;hp=f6ca0a0faa4bde09299db88d100fd1e9b8640f0a;hpb=d2478310649d51e14f8ece57651ca9d925d98793;p=python_utils.git diff --git a/persistent.py b/persistent.py index f6ca0a0..2751572 100644 --- a/persistent.py +++ b/persistent.py @@ -7,6 +7,7 @@ import enum import functools import logging from typing import Any +import warnings import file_utils @@ -143,7 +144,9 @@ class persistent_autoloaded_singleton(object): logger.debug(f'Attempting to load {cls.__name__} from persisted state.') self.instance = cls.load() if not self.instance: - logger.warning('Loading from cache failed.') + msg = 'Loading from cache failed.' + logger.warning(msg) + warnings.warn(msg) logger.debug(f'Attempting to instantiate {cls.__name__} directly.') self.instance = cls(*args, **kwargs) else: