Skip to content

Commit 1cd259d

Browse files
committed
Replaced the use of shutil.which() with getting directly the pythong executable dir path
1 parent ca84fc8 commit 1cd259d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

wfcommons/wfbench/translator/abstract_translator.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import logging
1212
import os
13+
import sys
1314
import pathlib
1415
import shutil
1516
import textwrap
@@ -90,8 +91,12 @@ def _copy_binary_files(self, output_folder: pathlib.Path) -> None:
9091
"""
9192
bin_folder = output_folder.joinpath("bin")
9293
bin_folder.mkdir(exist_ok=True)
93-
shutil.copy(shutil.which("wfbench"), bin_folder)
94-
shutil.copy(shutil.which("cpu-benchmark"), bin_folder)
94+
# Get the python executable dir
95+
python_executable_dir = os.path.dirname(sys.executable)
96+
# shutil.copy(shutil.which("wfbench"), bin_folder)
97+
shutil.copy(python_executable_dir + "/wfbench", bin_folder)
98+
# shutil.copy(shutil.which("cpu-benchmark"), bin_folder)
99+
shutil.copy(python_executable_dir + "/cpu-benchmark", bin_folder)
95100

96101
def _generate_input_files(self, output_folder: pathlib.Path) -> None:
97102
"""

0 commit comments

Comments
 (0)