# HG changeset patch # User Jun Wu # Date 1470837920 -3600 # 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 -r 39149b6036e6 -r 96bd27eb23f0 mercurial/ui.py --- a/mercurial/ui.py Tue Aug 09 16:45:28 2016 +0100 +++ b/mercurial/ui.py Wed Aug 10 15:05:20 2016 +0100 @@ -1175,6 +1175,7 @@ % ((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