summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 44a70bf0..14f9b80e 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -242,6 +242,16 @@ class coverage(object):
# Empty string is pretty useless
return None, "empty string isn't a filename"
+ if filename.startswith('memory:'):
+ if 0:
+ import dis, sys, StringIO
+ _stdout = sys.stdout
+ sys.stdout = new_stdout = StringIO.StringIO()
+ dis.dis(frame.f_code)
+ sys.stdout = _stdout
+ return None, new_stdout.getvalue()
+ return None, "memory isn't traceable"
+
if filename.startswith('<'):
# Lots of non-file execution is represented with artificial
# filenames like "<string>", "<doctest readme.txt[0]>", or