From 2d817c886617d693166ba50e0bafcc9a109d6edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20L=C3=B3pez?= Date: Wed, 1 Jan 2014 20:23:41 -0300 Subject: [PATCH] Fixed to work in Pyton 3.2/3.3 --- gitstatus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitstatus.py b/gitstatus.py index a18e72d..f350409 100755 --- a/gitstatus.py +++ b/gitstatus.py @@ -64,7 +64,7 @@ staged = str(nb_staged) conflicts = str(nb_U) changed = str(nb_changed) status_lines = Popen(['git','status','-s','-uall'],stdout=PIPE).communicate()[0].splitlines() -untracked_lines = [a for a in status_lines if a.startswith("??")] +untracked_lines = [a for a in map(lambda s: s.decode('utf-8'), status_lines) if a.startswith("??")] nb_untracked = len(untracked_lines) untracked = str(nb_untracked) stashes = Popen(['git','stash','list'],stdout=PIPE).communicate()[0].splitlines() @@ -84,7 +84,7 @@ if not branch: # not on any branch if tag: # if we are on a tag, print the tag's name branch = tag else: - branch = symbols['prehash']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0][:-1] + branch = symbols['prehash']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0].decode('utf-8')[:-1] else: remote_name = Popen(['git','config','branch.%s.remote' % branch], stdout=PIPE).communicate()[0].strip() if remote_name: