From 9b724b3b5efd684db7fb40f0e8205df8004c7daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=9B=E9=9C=B2=E5=85=88=E7=94=9F?= Date: Fri, 5 Sep 2025 09:57:39 +0800 Subject: [PATCH] Fix python_version in show_env.sh when its meets python3. (#9894) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Signed-off-by: zhanluxianshen --- show_env.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/show_env.sh b/show_env.sh index 83c47635c..84e37b3d7 100644 --- a/show_env.sh +++ b/show_env.sh @@ -41,12 +41,7 @@ else fi # get python version -python_version='' -if command -v python &> /dev/null; then - python_version=$(python --version | cut -d ' ' -f2) -else - python_version="Python not installed" -fi +python_version=$(python3 --version 2>&1 || python --version 2>&1 || echo "Python not installed") # Print all information echo "Current Repository: $git_repo_name"