summaryrefslogtreecommitdiff
path: root/coverage/misc.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-12-20 07:02:12 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-12-20 07:02:12 -0500
commit857e40a949bd69ad61392a6204cf91df18ea03d8 (patch)
treeb503bb750a4cfd764e2e0efae8d832d40a9496f1 /coverage/misc.py
parent8238758d8e13355ef61f4d99893e8cc510ea5e3c (diff)
downloadpython-coveragepy-857e40a949bd69ad61392a6204cf91df18ea03d8.tar.gz
Debugging to understand why 'trace function changed' appears.
Diffstat (limited to 'coverage/misc.py')
-rw-r--r--coverage/misc.py6
1 files changed, 6 insertions, 0 deletions
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.