summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/flake8/api/legacy.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/flake8/api/legacy.py b/src/flake8/api/legacy.py
index 0aec7d9..8c7d337 100644
--- a/src/flake8/api/legacy.py
+++ b/src/flake8/api/legacy.py
@@ -115,8 +115,9 @@ class StyleGuide(object):
def init_report(self, reporter=None):
"""Set up a formatter for this run of Flake8."""
- if (reporter is not None and
- not issubclass(reporter, formatter.BaseFormatter)):
+ if reporter is None:
+ return
+ if not issubclass(reporter, formatter.BaseFormatter):
raise ValueError("Report should be subclass of "
"flake8.formatter.BaseFormatter.")
self._application.make_formatter(reporter)