summaryrefslogtreecommitdiff
path: root/coverage/report.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/report.py')
-rw-r--r--coverage/report.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/coverage/report.py b/coverage/report.py
index 6c5510ad..5d187996 100644
--- a/coverage/report.py
+++ b/coverage/report.py
@@ -84,6 +84,11 @@ class Reporter(object):
for cu in self.code_units:
try:
report_fn(cu, self.coverage._analyze(cu))
- except (NoSource, NotPython):
+ except NoSource:
if not self.ignore_errors:
raise
+ except NotPython:
+ # Only report errors for .py files, and only if we didn't
+ # explicitly suppress those errors.
+ if cu.should_be_python(".py") and not self.ignore_errors:
+ raise