diff --git a/migen/fhdl/namer.py b/migen/fhdl/namer.py index 070d4ba7e..c2ef318cc 100644 --- a/migen/fhdl/namer.py +++ b/migen/fhdl/namer.py @@ -34,6 +34,8 @@ def trace_back(name=None): obj = frame.f_locals["self"] except KeyError: obj = None + if obj is not None and hasattr(obj, "__del__"): + obj = None if obj is None: modules = frame.f_globals["__name__"] modules = modules.split(".")