From 6c5ea3285736b408857ca9000bc48be94362d7fe Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Tue, 19 May 2020 08:03:13 +0800 Subject: [PATCH] Fix installing pickle5-backport for Python 3.8.2 (#8453) --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 04d3b81a4..cd2657a2a 100755 --- a/build.sh +++ b/build.sh @@ -135,7 +135,8 @@ if [ "$RAY_BUILD_PYTHON" == "YES" ]; then pickle5_available=0 pickle5_path="$ROOT_DIR/python/ray/pickle5_files" # Check if the current Python alrady has pickle5 (either comes with newer Python versions, or has been installed by us before). - if PYTHONPATH="$pickle5_path:$PYTHONPATH" "$PYTHON_EXECUTABLE" -s -c "import pickle5" 2>/dev/null; then + check_pickle5_command="import sys\nif sys.version_info < (3, 8, 2): import pickle5;" + if PYTHONPATH="$pickle5_path:$PYTHONPATH" "$PYTHON_EXECUTABLE" -s -c "exec(\"$check_pickle5_command\")" 2>/dev/null; then pickle5_available=1 fi if [ 1 -ne "${pickle5_available}" ]; then