mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-11 15:24:18 +00:00
Minor refactoring
This commit is contained in:
parent
2f577791db
commit
4d9a88298b
1 changed files with 3 additions and 4 deletions
|
|
@ -128,11 +128,10 @@ def run(command, raw_output=False, decode=True):
|
||||||
# endswith to be given a bytes object or a tuple of bytes but not native
|
# endswith to be given a bytes object or a tuple of bytes but not native
|
||||||
# string objects. This is simply less mysterious than using b'.py' in the
|
# string objects. This is simply less mysterious than using b'.py' in the
|
||||||
# endswith method. That should work but might still fail horribly.
|
# endswith method. That should work but might still fail horribly.
|
||||||
if hasattr(stdout, 'decode'):
|
if decode:
|
||||||
if decode:
|
if hasattr(stdout, 'decode'):
|
||||||
stdout = stdout.decode('utf-8')
|
stdout = stdout.decode('utf-8')
|
||||||
if hasattr(stderr, 'decode'):
|
if hasattr(stderr, 'decode'):
|
||||||
if decode:
|
|
||||||
stderr = stderr.decode('utf-8')
|
stderr = stderr.decode('utf-8')
|
||||||
if not raw_output:
|
if not raw_output:
|
||||||
stdout = [line.strip() for line in stdout.splitlines()]
|
stdout = [line.strip() for line in stdout.splitlines()]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue