summaryrefslogtreecommitdiff
path: root/coverage/inorout.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/inorout.py')
-rw-r--r--coverage/inorout.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/coverage/inorout.py b/coverage/inorout.py
index 8badf4f7..174a19dc 100644
--- a/coverage/inorout.py
+++ b/coverage/inorout.py
@@ -180,10 +180,11 @@ def add_coverage_paths(paths):
# When testing, we use PyContracts, which should be considered
# part of coverage.py, and it uses six. Exclude those directories
# just as we exclude ourselves.
- import contracts
- import six
- for mod in [contracts, six]:
- paths.add(canonical_path(mod))
+ if env.USE_CONTRACTS:
+ import contracts
+ import six
+ for mod in [contracts, six]:
+ paths.add(canonical_path(mod))
class InOrOut: