diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-02-10 17:16:58 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-02-10 17:16:58 +0100 |
| commit | 94148135abcc397ad0ac4475cf8ef4fa7b73308a (patch) | |
| tree | 66b067940831bf3006bfa0673a4601e494206c10 | |
| parent | 4c0830ffbc045290c167e482855cb25a639df0e0 (diff) | |
| download | allocbench-94148135abcc397ad0ac4475cf8ef4fa7b73308a.tar.gz allocbench-94148135abcc397ad0ac4475cf8ef4fa7b73308a.zip | |
don't use subprocess.check_output to support python3 < 3.7.0
| -rw-r--r-- | src/allocators.py | 5 | ||||
| -rw-r--r-- | src/benchmark.py | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/allocators.py b/src/allocators.py index dbf26d1..717c500 100644 --- a/src/allocators.py +++ b/src/allocators.py @@ -12,8 +12,9 @@ allocators = {"libc": {"cmd_prefix" : "", for i, t in enumerate(maybe_allocators): try: - path = subprocess.check_output('whereis lib{} | cut -d":" -f2'.format(t), - shell=True, text=True).strip() + path = subprocess.run('whereis lib{} | cut -d":" -f2'.format(t), + shell=True, stdout=subprocess.PIPE, + universal_newlines=True).stdout.strip() if path != "": allocators[t] = {"cmd_prefix": "", "binary_suffix": "", diff --git a/src/benchmark.py b/src/benchmark.py index 583b05b..7bf709e 100644 --- a/src/benchmark.py +++ b/src/benchmark.py @@ -156,8 +156,10 @@ class Benchmark (object): # Find absolute path of executable binary_end = actual_cmd.find(" ") - binary = subprocess.check_output(["whereis", actual_cmd[0:binary_end]], - universal_newlines=True).split()[1] + binary = subprocess.run(["whereis", actual_cmd[0:binary_end]], + stdout=subprocess.PIPE, + universal_newlines=True).stdout.split()[1] + actual_cmd = binary + actual_cmd[binary_end:] actual_cmd = t["cmd_prefix"] + " " + actual_cmd |
