Skip to content

Commit 9b415e5

Browse files
committed
More Py2/3 compatibility changes
- Legacy-Id: 16582
1 parent ba12077 commit 9b415e5

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

bin/mergeready

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ COPYRIGHT
3636
Open Source Initiative at http://opensource.org/licenses/BSD-2-Clause.
3737
3838
"""
39-
from __future__ import print_function
39+
from __future__ import print_function, unicode_literals
4040

4141
import sys
4242
import os
@@ -132,7 +132,7 @@ def pipe(cmd, inp=None):
132132
code = pipe.returncode
133133
if code != 0:
134134
raise OSError(err)
135-
return out
135+
return out.decode('utf-8')
136136

137137
def split_loginfo(line):
138138
try:
@@ -153,7 +153,7 @@ def split_loginfo(line):
153153

154154
# Get repository information
155155
svn_info = {}
156-
for line in pipe('svn info .').decode('utf-8').splitlines():
156+
for line in pipe('svn info .').splitlines():
157157
if line:
158158
key, value = line.strip().split(':', 1)
159159
svn_info[key] = value.strip()
@@ -179,7 +179,7 @@ merged_revs = {}
179179
write_cache = False
180180
loginfo_format = r'^r[0-9]+ \| [^@]+@[^@]+ \| \d\d\d\d-\d\d-\d\d '
181181
note("Getting svn:mergeinfo for current branch")
182-
for line in pipe('svn propget svn:mergeinfo .').decode('utf-8').splitlines():
182+
for line in pipe('svn propget svn:mergeinfo .').splitlines():
183183
if opt_verbose:
184184
sys.stderr.write('.')
185185
if line in mergeinfo:
@@ -357,7 +357,7 @@ for branch in branches:
357357
commits.sort()
358358
unmerged_branch_commits[branch] = commits
359359

360-
keys = all_commits.keys()
360+
keys = list(all_commits.keys())
361361
keys.sort()
362362
# Check that we don't have holes in the commit list -- commits not mentioned
363363
# as ready for merge, and not already merged, earlier than a waiting commit.
@@ -379,15 +379,15 @@ for key in keys:
379379
sys.stderr.write("\n")
380380
del unmerged_branch_commits[branch][0]
381381

382-
keys = not_passed.keys()
382+
keys = list(not_passed.keys())
383383
keys.sort()
384384
if len(keys) > 0:
385385
sys.stderr.write("Commits marked ready which haven't passed the test suite:\n")
386386
for key in keys:
387387
sys.stderr.write(not_passed[key]+'\n')
388388
sys.stderr.write('\n')
389389

390-
keys = ready_commits.keys()
390+
keys = list(ready_commits.keys())
391391
keys.sort()
392392
for key in keys:
393393
print(ready_commits[key])

0 commit comments

Comments
 (0)