Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Commit

Permalink
Use communicate instead of read twice. Fixes #9.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpyder committed Apr 28, 2014
1 parent 2552f7b commit 1976a37
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sublime_ocp_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ def run_ocp(self, command, includes, module, query, context, settings):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)

error = proc.stderr.read().decode('utf-8').strip()
output = proc.stdout.read().decode('utf-8').strip()
(stdoutdata, stderrdata) = proc.communicate()

error = stderrdata.decode('utf-8').strip()
output = stdoutdata.decode('utf-8').strip()

if error:
return error
Expand Down

0 comments on commit 1976a37

Please sign in to comment.