From 55a3172e37855f388b9ba0dfc91641a6c9ad1376 Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 12 Jan 2022 09:06:29 -0800 Subject: Scale back warnings.warn and add stacklevels= where appropriate. --- persistent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'persistent.py') diff --git a/persistent.py b/persistent.py index 2751572..83e6900 100644 --- a/persistent.py +++ b/persistent.py @@ -146,7 +146,7 @@ class persistent_autoloaded_singleton(object): if not self.instance: msg = 'Loading from cache failed.' logger.warning(msg) - warnings.warn(msg) + warnings.warn(msg, stacklevel=2) logger.debug(f'Attempting to instantiate {cls.__name__} directly.') self.instance = cls(*args, **kwargs) else: -- cgit v1.3