diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-09-04 23:22:50 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-09-04 23:22:50 +0200 |
| commit | 46cc0ee59f4f3032d326461d8915e81fa80bb7c3 (patch) | |
| tree | e026951503bce57606d2ef642b32aab15ef528c0 | |
| parent | e0ea88078322de8d8f9d815f3ee119bafe597ccf (diff) | |
| download | allocbench-46cc0ee59f4f3032d326461d8915e81fa80bb7c3.tar.gz allocbench-46cc0ee59f4f3032d326461d8915e81fa80bb7c3.zip | |
fix src.util.prefix_cmd_with_abspath for commands without arguments
| -rw-r--r-- | src/util.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/util.py b/src/util.py index 6ec984a..027cbcb 100644 --- a/src/util.py +++ b/src/util.py @@ -71,9 +71,14 @@ def prefix_cmd_with_abspath(cmd): binary_abspath = subprocess.run(["whereis", cmd[0:binary_end]], stdout=subprocess.PIPE, - universal_newlines=True).stdout.split()[1] + universal_newlines=True).stdout + binary_abspath = binary_abspath.split()[1] - return binary_abspath + " " + cmd[binary_end:] + # add arguments of cmd to the abspath + if binary_end: + return binary_abspath + " " + cmd[binary_end:] + else: + return binary_abspath def allocbench_msg(color, *objects, sep=' ', end='\n', file=sys.stdout): |
