Skip to content

Commit 230a7fc

Browse files
seanpmorganWindQAQ
authored andcommitted
Install python3.6 only when testing with python3 (#388)
* Install python3.6 only when testing with python3 * Specify py3.6
1 parent 47e6877 commit 230a7fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/run_docker.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ case ${DEVICE} in
7575
esac
7676

7777
case ${PYTHON} in
78-
py2) PYTHON_LIB=/usr/bin/python2;;
79-
py3) PYTHON_LIB=/usr/bin/python3;;
78+
py2) ENVIRONMENT_CMD="ln -sf /usr/bin/python2 /usr/bin/python";;
79+
py3) ENVIRONMENT_CMD="tools/ci_testing/install_py36.sh && ln -sf /usr/bin/python3.6 /usr/bin/python";;
8080
*)
8181
echo "Invalid or missing python $OPTARG"
8282
exit 1
@@ -88,7 +88,7 @@ if [[ -z "${COMMAND}" ]]; then
8888
exit 1
8989
fi
9090

91-
DOCKER_CMD="tools/ci_testing/install_py36.sh && ln -sf ${PYTHON_LIB} /usr/bin/python && ${COMMAND}"
91+
DOCKER_CMD="${ENVIRONMENT_CMD} && ${COMMAND}"
9292
echo "Docker image: ${DOCKER_IMAGE}"
9393
echo "Docker command: ${DOCKER_CMD}"
9494
docker run ${DOCKER_OPTS} \

0 commit comments

Comments
 (0)