Skip to content

Commit

Permalink
Switch back from subprocess.run to subprocess.Popen to support python…
Browse files Browse the repository at this point in the history
… < 3.5
  • Loading branch information
albertyw committed Feb 16, 2017
1 parent 8882755 commit 6cecda1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions git_browse/browse.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,16 @@ def get_focus_object(sys_argv, path):

def get_commit_hash(focus_object):
command = ['git', 'show', focus_object]
process = subprocess.run(
process = subprocess.Popen(
command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
stderr=subprocess.PIPE,
universal_newlines=True
)
out, err = process.communicate()
if process.returncode != 0:
return None
output = process.stdout.decode('utf-8')
commit_hash = output.split("\n")[0].split(" ")[1]
commit_hash = out.split("\n")[0].split(" ")[1]
return FocusHash(commit_hash)


Expand Down

0 comments on commit 6cecda1

Please sign in to comment.