From 857e40a949bd69ad61392a6204cf91df18ea03d8 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 20 Dec 2012 07:02:12 -0500 Subject: Debugging to understand why 'trace function changed' appears. --- coverage/misc.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'coverage/misc.py') diff --git a/coverage/misc.py b/coverage/misc.py index 3ed854a..b4d1c83 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -54,6 +54,12 @@ def format_lines(statements, lines): return ret +def short_stack(): + """Return a string summarizing the call stack.""" + stack = inspect.stack()[:0:-1] + return "\n".join("%30s : %s @%d" % (t[3],t[1],t[2]) for t in stack) + + def expensive(fn): """A decorator to cache the result of an expensive operation. -- cgit v1.2.1