@@ -595,9 +595,10 @@ function checkMacPython2(){
595
595
else
596
596
python_version=" "
597
597
fi
598
+ check_python=` echo $python_version | grep " Python 2" `
598
599
if [ " $python_version " == " " ] || [ " $python_root " == " /usr/bin/python" -a " $python_version " == " Python 2.7.10" ] ; then
599
600
python_version=" "
600
- else
601
+ elif [ -n " $check_python " ] ; then
601
602
while true
602
603
do
603
604
read -p "
@@ -617,7 +618,10 @@ function checkMacPython2(){
617
618
if [ " $use_python " == " y" ]; then
618
619
break
619
620
fi
620
- fi
621
+ else
622
+ echo " 您输入Python的不是Python2"
623
+ python_version=" "
624
+ fi
621
625
done
622
626
}
623
627
@@ -633,9 +637,10 @@ function checkMacPython3(){
633
637
else
634
638
python_version=" "
635
639
fi
640
+ check_python=` echo $python_version | grep " Python 3" `
636
641
if [ " $python_version " == " " ] || [ " $python_root " == " /usr/bin/python" -a " $python_version " == " Python 2.7.10" ] ; then
637
642
python_version=" "
638
- else
643
+ elif [ -n " $check_python " ] ; then
639
644
while true
640
645
do
641
646
read -p "
@@ -655,7 +660,10 @@ function checkMacPython3(){
655
660
if [ " $use_python " == " y" ]; then
656
661
break
657
662
fi
658
- fi
663
+ else
664
+ echo " 您输入Python的不是Python3"
665
+ python_version=" "
666
+ fi
659
667
done
660
668
}
661
669
@@ -697,7 +705,7 @@ function checkMacPythonVersion(){
697
705
if [ " $python_V " == " " ]; then
698
706
python_V=" 2"
699
707
fi
700
- read -n1 -p " 您选择了数字【" $python_V " 】,正在寻找符合您要求的Python版本,请按回车键继续..."
708
+ echo " 您选择了数字【" $python_V " 】,正在寻找符合您要求的Python版本,请按回车键继续..."
701
709
echo
702
710
if [ " $python_V " == " 2" ]; then
703
711
python_root=` which python2.7`
@@ -771,7 +779,6 @@ function checkMacPythonVersion(){
771
779
uncode=" m"
772
780
fi
773
781
fi
774
- echo ${python_list[@]}
775
782
version_list=` echo " ${python_list[@]} " | grep " $python_brief_version " `
776
783
if [ " $version_list " != " " ]; then
777
784
break
0 commit comments