diff options
Diffstat (limited to 'coverage/collector.py')
-rw-r--r-- | coverage/collector.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/coverage/collector.py b/coverage/collector.py index 9c40d16c..9752e530 100644 --- a/coverage/collector.py +++ b/coverage/collector.py @@ -233,8 +233,25 @@ class Collector(object): self._collectors[-1].pause() self._collectors.append(self) #print >>sys.stderr, "Started: %r" % self._collectors + + # Check to see whether we had a fullcoverage tracer installed. + traces0 = None + if hasattr(sys, "gettrace"): + fn0 = sys.gettrace() + if fn0: + tracer0 = getattr(fn0, '__self__', None) + if tracer0: + traces0 = getattr(tracer0, 'traces', None) + # Install the tracer on this thread. - self._start_tracer() + fn = self._start_tracer() + + if traces0: + #print("traces0 has %d" % len(traces0)) + for args in traces0: + frame, event, arg = args + fn(*args) + # Install our installation tracer in threading, to jump start other # threads. threading.settrace(self._installation_trace) |