Skip to content

Commit 6f97c7a

Browse files
committed
test: make test_util more python 3 friendly
The last set of changes to make it backwards compatible with Python 2 required converting the arguments. That is not compatible on Python 3 unfortunately. Only perform that on Python 2 to make the utility compatible with 2 and 3.
1 parent 7fccbad commit 6f97c7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/incrparse/test_util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def escapeCmdArg(arg):
2222

2323

2424
def run_command(cmd):
25-
cmd = list(map(lambda s: s.encode('utf-8'), cmd))
25+
if sys.version_info[0] < 3:
26+
cmd = list(map(lambda s: s.encode('utf-8'), cmd))
2627
print(' '.join([escapeCmdArg(arg) for arg in cmd]))
2728
return subprocess.check_output(cmd, stderr=subprocess.STDOUT)
2829

0 commit comments

Comments
 (0)