mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-15 08:44:46 +00:00
Checking output line and encoding it if it is Unicode
This commit is contained in:
parent
733a4f053b
commit
1ae5e0afe6
1 changed files with 2 additions and 0 deletions
|
|
@ -166,6 +166,8 @@ class BaseFormatter(object):
|
||||||
|
|
||||||
def _write(self, output):
|
def _write(self, output):
|
||||||
"""Handle logic of whether to use an output file or print()."""
|
"""Handle logic of whether to use an output file or print()."""
|
||||||
|
if not isinstance(output, str):
|
||||||
|
output = output.encode('UTF-8')
|
||||||
if self.output_fd is not None:
|
if self.output_fd is not None:
|
||||||
self.output_fd.write(output + self.newline)
|
self.output_fd.write(output + self.newline)
|
||||||
if self.output_fd is None or self.options.tee:
|
if self.output_fd is None or self.options.tee:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue