summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/collector.py3
-rw-r--r--coverage/fullcoverage/encodings.py7
2 files changed, 6 insertions, 4 deletions
diff --git a/coverage/collector.py b/coverage/collector.py
index 3821de0..743a03e 100644
--- a/coverage/collector.py
+++ b/coverage/collector.py
@@ -259,7 +259,8 @@ class Collector(object):
fn = self._start_tracer()
for args in traces0:
- fn(*args)
+ (frame, event, arg), lineno = args
+ fn(frame, event, arg, lineno=lineno)
# Install our installation tracer in threading, to jump start other
# threads.
diff --git a/coverage/fullcoverage/encodings.py b/coverage/fullcoverage/encodings.py
index 539d2dd..ad350bc 100644
--- a/coverage/fullcoverage/encodings.py
+++ b/coverage/fullcoverage/encodings.py
@@ -31,7 +31,8 @@ class FullCoverageTracer(object):
self.traces = []
def fullcoverage_trace(self, *args):
- self.traces.append(args)
+ frame, event, arg = args
+ self.traces.append((args, frame.f_lineno))
return self.fullcoverage_trace
sys.settrace(FullCoverageTracer().fullcoverage_trace)
@@ -42,7 +43,7 @@ sys.settrace(FullCoverageTracer().fullcoverage_trace)
# happen last, since all of the symbols in this module will become None
# at that exact moment, including "sys".
-parentdirs = sorted(filter(__file__.startswith, sys.path), key=len)
-sys.path.remove(parentdirs[-1])
+parentdir = max(filter(__file__.startswith, sys.path), key=len)
+sys.path.remove(parentdir)
del sys.modules['encodings']
import encodings