summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml4
-rw-r--r--coverage/collector.py9
2 files changed, 11 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index 6527f613..232d9430 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,7 +15,9 @@ install:
- python setup.py clean develop
before_script:
- - python -m coverage debug sys
+ - pwd
+ - ls -l
+ - coverage debug sys
script:
- python igor.py zip_mods install_egg
diff --git a/coverage/collector.py b/coverage/collector.py
index 9a74700d..8ba7d87c 100644
--- a/coverage/collector.py
+++ b/coverage/collector.py
@@ -52,10 +52,14 @@ class PyTracer(object):
self.last_exc_firstlineno = 0
self.arcs = False
self.thread = None
+ self.stopped = False
def _trace(self, frame, event, arg_unused):
"""The trace function passed to sys.settrace."""
+ if self.stopped:
+ return
+
if 0:
sys.stderr.write("trace event: %s %r @%d\n" % (
event, frame.f_code.co_filename, frame.f_lineno
@@ -126,8 +130,11 @@ class PyTracer(object):
def stop(self):
"""Stop this Tracer."""
+ self.stopped = True
if self.thread != threading.currentThread():
- # Called on a different thread than started us: do nothing.
+ # Called on a different thread than started us: we can't unhook
+ # ourseves, but we've set the flag that we should stop, so we won't
+ # do any more tracing.
return
if hasattr(sys, "gettrace") and self.warn: