summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/control.py6
-rw-r--r--coverage/debug.py2
-rw-r--r--coverage/files.py2
3 files changed, 4 insertions, 6 deletions
diff --git a/coverage/control.py b/coverage/control.py
index cb917e52..84e85666 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -186,7 +186,7 @@ class coverage(object):
)
# The dirs for files considered "installed with the interpreter".
- self.pylib_dirs = []
+ self.pylib_dirs = set()
if not self.config.cover_pylib:
# Look at where some standard modules are located. That's the
# indication for "installed with the interpreter". In some
@@ -195,9 +195,7 @@ class coverage(object):
# we've imported, and take all the different ones.
for m in (atexit, os, random, socket, _structseq):
if m is not None and hasattr(m, "__file__"):
- m_dir = self._canonical_dir(m)
- if m_dir not in self.pylib_dirs:
- self.pylib_dirs.append(m_dir)
+ self.pylib_dirs.add(self._canonical_dir(m))
# To avoid tracing the coverage code itself, we skip anything located
# where we are.
diff --git a/coverage/debug.py b/coverage/debug.py
index 6908383d..6e7af242 100644
--- a/coverage/debug.py
+++ b/coverage/debug.py
@@ -45,7 +45,7 @@ def info_formatter(info):
for label, data in info:
if data == []:
data = "-none-"
- if isinstance(data, (list, tuple)):
+ if isinstance(data, (list, set, tuple)):
prefix = "%*s:" % (label_len, label)
for e in data:
yield "%*s %s" % (label_len+1, prefix, e)
diff --git a/coverage/files.py b/coverage/files.py
index 08ce1e84..72c0bf92 100644
--- a/coverage/files.py
+++ b/coverage/files.py
@@ -147,7 +147,7 @@ def prep_patterns(patterns):
class TreeMatcher(object):
"""A matcher for files in a tree."""
def __init__(self, directories):
- self.dirs = directories[:]
+ self.dirs = list(directories)
def __repr__(self):
return "<TreeMatcher %r>" % self.dirs