Skip to content

Commit 87dc874

Browse files
author
Vladimir Kotal
committed
treat all Command arguments as strings when substituting
1 parent 181b571 commit 87dc874

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ def fill_arg(self, args_append=None, args_subst=None):
333333
newcmd = []
334334
subst_done = -1
335335
for i, cmdarg in enumerate(self.cmd):
336+
cmdarg = str(cmdarg)
336337
if args_subst:
337338
for pattern in args_subst.keys():
338339
if pattern in cmdarg:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434

3535

3636
def test_subst_append_default():
37-
cmd = Command(['foo', '=ARG=', 'bar'],
37+
cmd = Command(['foo', '=ARG=', 33, 'bar'],
3838
args_subst={"ARG": "blah"},
3939
args_append=["1", "2"])
40-
assert cmd.cmd == ['foo', '=blah=', '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)