File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -58,11 +58,10 @@ def run_flake8(args):
5858 cmd = ['python' , '-m' , 'flake8' ]
5959 cmd .extend (args )
6060 p = Popen (cmd , stdout = PIPE , stderr = PIPE )
61- stderr = p .stderr . read (). decode ()
61+ ( stdout , stderr ) = p .communicate ()
6262 if stderr :
63- log .error ("Error while running flake8 '%s'" , stderr )
64- stdout = p .stdout
65- return stdout .read ().decode ()
63+ log .error ("Error while running flake8 '%s'" , stderr .decode ())
64+ return stdout .decode ()
6665
6766
6867def build_args (options , doc_path ):
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ def test_flake8_lint(config):
5757
5858def test_flake8_config_param (config ):
5959 with patch ('pyls.plugins.flake8_lint.Popen' ) as popen_mock :
60+ mock_instance = popen_mock .return_value
61+ mock_instance .communicate .return_value = [bytes (), bytes ()]
6062 flake8_conf = '/tmp/some.cfg'
6163 config .update ({'plugins' : {'flake8' : {'config' : flake8_conf }}})
6264 _name , doc = temp_document (DOC )
You can’t perform that action at this time.
0 commit comments