Skip to content

Commit 07b7410

Browse files
author
Vladimir Kotal
committed
convert the whole command array to string
1 parent 87dc874 commit 07b7410

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

opengrok-tools/src/main/python/opengrok_tools/utils/command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(self, cmd, args_subst=None, args_append=None, logger=None,
5959
if isinstance(doprint, list):
6060
doprint = doprint[0]
6161

62-
self.cmd = cmd
62+
self.cmd = list(map(str, cmd))
6363
self.state = "notrun"
6464
self.excl_subst = excl_subst
6565
self.work_dir = work_dir
@@ -70,6 +70,7 @@ def __init__(self, cmd, args_subst=None, args_append=None, logger=None,
7070
self.limits = resource_limits
7171
self.doprint = doprint
7272
self.err = None
73+
self.returncode = None
7374

7475
self.logger = logger or logging.getLogger(__name__)
7576

@@ -333,7 +334,6 @@ def fill_arg(self, args_append=None, args_subst=None):
333334
newcmd = []
334335
subst_done = -1
335336
for i, cmdarg in enumerate(self.cmd):
336-
cmdarg = str(cmdarg)
337337
if args_subst:
338338
for pattern in args_subst.keys():
339339
if pattern in cmdarg:

opengrok-tools/src/test/python/test_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_subst_append_default():
3737
cmd = Command(['foo', '=ARG=', 33, 'bar'],
3838
args_subst={"ARG": "blah"},
3939
args_append=["1", "2"])
40-
assert cmd.cmd == ['foo', '=blah=', 33, 'bar', '1', '2']
40+
assert cmd.cmd == ['foo', '=blah=', '33', 'bar', '1', '2']
4141

4242

4343
def test_subst_append_exclsubst():

0 commit comments

Comments
 (0)