From 7230508e7cbcc783c302de1f0a05405d20487a29 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 6 Mar 2012 14:18:22 +0100 Subject: [PATCH] fhdl/namer: do not reference objects with __del__ methods to avoid uncollectable cycles --- migen/fhdl/namer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migen/fhdl/namer.py b/migen/fhdl/namer.py index 070d4ba7..c2ef318c 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(".") -- 2.30.2