From 22650e50866c4669cab01bf1933db2b87d28249d Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Sat, 30 Jul 2016 06:42:34 -0500 Subject: Reset Application.formatter attribute in init_report For our Legacy API users, StyleGuide.init_report should reset the formatter attribute before calling Application.make_formatter(). Closes #200 --- src/flake8/api/legacy.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/flake8/api') diff --git a/src/flake8/api/legacy.py b/src/flake8/api/legacy.py index 8c7d337..1277460 100644 --- a/src/flake8/api/legacy.py +++ b/src/flake8/api/legacy.py @@ -120,6 +120,7 @@ class StyleGuide(object): if not issubclass(reporter, formatter.BaseFormatter): raise ValueError("Report should be subclass of " "flake8.formatter.BaseFormatter.") + self._application.formatter = None self._application.make_formatter(reporter) self._application.guide = None # NOTE(sigmavirus24): This isn't the intended use of -- cgit v1.2.1