Mercurial > hg
changeset 29762:96bd27eb23f0
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.
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 10 Aug 2016 15:05:20 +0100 |
parents | 39149b6036e6 |
children | ce6317dcb944 |
files | mercurial/ui.py |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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