From adb50f8f6a04c68c542c9dd7db8f2b24ae00ad47 Mon Sep 17 00:00:00 2001 From: Maksim Rakitin Date: Tue, 2 Feb 2021 14:10:31 -0500 Subject: [PATCH] Store modules and line numbers as strings, not the whole frames --- ophyd/ophydobj.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ophyd/ophydobj.py b/ophyd/ophydobj.py index 315a93ea1..3aaa80ac9 100644 --- a/ophyd/ophydobj.py +++ b/ophyd/ophydobj.py @@ -144,7 +144,8 @@ def __init__(self, *, name=None, attr_name='', parent=None, labels=None, kind=None): if OPHYD_DEBUG_WITH_INSPECT: - self._stack_init = inspect.stack() + stack = inspect.stack() + self._stack_init = [f'{s.filename}:{s.lineno}' for s in stack] if labels is None: labels = set() @@ -229,7 +230,8 @@ def __init_subclass__(cls, version=None, version_of=None, if OPHYD_DEBUG_WITH_INSPECT: print(f'Subclassing {cls.__name__}...') - cls._stack_subclass = inspect.stack() + stack = inspect.stack() + cls._stack_subclass = [f'{s.filename}:{s.lineno}' for s in stack] super().__init_subclass__(**kwargs)