diff options
-rwxr-xr-x | project.py | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -1141,6 +1141,8 @@ class Project(object): | |||
1141 | capture_stderr=True) | 1141 | capture_stderr=True) |
1142 | has_diff = False | 1142 | has_diff = False |
1143 | for line in p.process.stdout: | 1143 | for line in p.process.stdout: |
1144 | if not hasattr(line, 'encode'): | ||
1145 | line = line.decode() | ||
1144 | if not has_diff: | 1146 | if not has_diff: |
1145 | out.nl() | 1147 | out.nl() |
1146 | out.project('project %s/' % self.relpath) | 1148 | out.project('project %s/' % self.relpath) |
@@ -1595,7 +1597,7 @@ class Project(object): | |||
1595 | last_mine = None | 1597 | last_mine = None |
1596 | cnt_mine = 0 | 1598 | cnt_mine = 0 |
1597 | for commit in local_changes: | 1599 | for commit in local_changes: |
1598 | commit_id, committer_email = commit.decode('utf-8').split(' ', 1) | 1600 | commit_id, committer_email = commit.split(' ', 1) |
1599 | if committer_email == self.UserEmail: | 1601 | if committer_email == self.UserEmail: |
1600 | last_mine = commit_id | 1602 | last_mine = commit_id |
1601 | cnt_mine += 1 | 1603 | cnt_mine += 1 |
@@ -2406,10 +2408,7 @@ class Project(object): | |||
2406 | cmd = ['ls-remote', self.remote.name, refs] | 2408 | cmd = ['ls-remote', self.remote.name, refs] |
2407 | p = GitCommand(self, cmd, capture_stdout=True) | 2409 | p = GitCommand(self, cmd, capture_stdout=True) |
2408 | if p.Wait() == 0: | 2410 | if p.Wait() == 0: |
2409 | if hasattr(p.stdout, 'decode'): | 2411 | return p.stdout |
2410 | return p.stdout.decode('utf-8') | ||
2411 | else: | ||
2412 | return p.stdout | ||
2413 | return None | 2412 | return None |
2414 | 2413 | ||
2415 | def _Revert(self, rev): | 2414 | def _Revert(self, rev): |
@@ -2820,6 +2819,8 @@ class Project(object): | |||
2820 | capture_stderr=True) | 2819 | capture_stderr=True) |
2821 | try: | 2820 | try: |
2822 | out = p.process.stdout.read() | 2821 | out = p.process.stdout.read() |
2822 | if not hasattr(out, 'encode'): | ||
2823 | out = out.decode() | ||
2823 | r = {} | 2824 | r = {} |
2824 | if out: | 2825 | if out: |
2825 | out = iter(out[:-1].split('\0')) | 2826 | out = iter(out[:-1].split('\0')) |
@@ -2979,10 +2980,6 @@ class Project(object): | |||
2979 | raise GitError('%s %s: %s' % | 2980 | raise GitError('%s %s: %s' % |
2980 | (self._project.name, name, p.stderr)) | 2981 | (self._project.name, name, p.stderr)) |
2981 | r = p.stdout | 2982 | r = p.stdout |
2982 | try: | ||
2983 | r = r.decode('utf-8') | ||
2984 | except AttributeError: | ||
2985 | pass | ||
2986 | if r.endswith('\n') and r.index('\n') == len(r) - 1: | 2983 | if r.endswith('\n') and r.index('\n') == len(r) - 1: |
2987 | return r[:-1] | 2984 | return r[:-1] |
2988 | return r | 2985 | return r |