Skip to content

Commit 5e3aafd

Browse files
committed
Move python binary check before pip3_install'ing pyperformance. Clarify error message
1 parent 3355b88 commit 5e3aafd

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

pyperf/pyperf_run

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pip3_install()
142142
if [ $install_pip -eq 1 ]; then
143143
$python_exec -m ensurepip || exit_out "Failed to install pip." 1
144144
else
145-
exit_out "Pip not available for install of $1 failed." 1
145+
exit_out "Pip is not available, exiting out" 1
146146
fi
147147
fi
148148

@@ -290,17 +290,18 @@ done
290290
if [ $to_pbench -eq 0 ]; then
291291
rm -rf pyperformance
292292

293+
if ! command -v $python_exec; then
294+
exit_out "Error: Designated python executable, $python_exec, not present"
295+
fi
296+
293297
pip3_install "pyperformance==$PYPERF_VERSION"
294298

295299
cd pyperformance
296300
if [[ ${python_pkgs} != "" ]]; then
297301
pkg_list=`echo $python_pkgs | sed "s/,/ /g"`
298302
test_tools/package_install --packages "$python_pkgs" --no_packages $to_no_pkg_install
299303
fi
300-
if ! command -v $python_exec; then
301-
exit_out "Error: Designated python executable, $python_exec, not present"
302-
fi
303-
fi
304+
304305
pip3_install psutil
305306
pip3_install packaging
306307
pip3_install pyparsing

0 commit comments

Comments
 (0)