# HG changeset patch # User Jun Wu # Date 2016-08-10 14:05:20 # Node ID 96bd27eb23f0593ccd8671d945a2106844c6cdad # Parent 39149b6036e6d08082907f174443f9cff18f988d ui: drop values returned by inspect.*frame*() to avoid cycles "f = inspect.currentframe()" instantly creates a cycle because "f.f_locals['f']" is "f" itself. This patch explicitly sets those frame objects to None to avoid cycles. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -1175,6 +1175,7 @@ class ui(object): % ((msg,) + calframe[stacklevel][1:4])) self.log('develwarn', '%s at: %s:%s (%s)\n', msg, *calframe[stacklevel][1:4]) + curframe = calframe = None # avoid cycles def deprecwarn(self, msg, version): """issue a deprecation warning