@@ -36,37 +36,37 @@ createvirtualenv () {
3636# PYTHON = find_python3
3737find_python3 () {
3838 PYTHON=" "
39- # Add a fallback system python3 if it is available and Python 3.10 +.
40- if is_python_310 " $( command -v python3) " ; then
39+ # Add a fallback system python3 if it is available and Python 3.9 +.
40+ if is_python_39 " $( command -v python3) " ; then
4141 PYTHON=" $( command -v python3) "
4242 fi
4343 # Find a suitable toolchain version, if available.
4444 if [ " $( uname -s) " = " Darwin" ]; then
45- PYTHON=" /Library/Frameworks/Python.Framework/Versions/3.10 /bin/python3"
45+ PYTHON=" /Library/Frameworks/Python.Framework/Versions/3.9 /bin/python3"
4646 elif [ " Windows_NT" = " ${OS:- } " ]; then # Magic variable in cygwin
4747 PYTHON=" C:/python/Python310/python.exe"
4848 else
49- # Prefer our own toolchain, fall back to mongodb toolchain if it has Python 3.10 +.
50- if [ -f " /opt/python/3.10 /bin/python3" ]; then
51- PYTHON=" /opt/python/3.10 /bin/python3"
52- elif is_python_310 " $( command -v /opt/mongodbtoolchain/v4/bin/python3) " ; then
49+ # Prefer our own toolchain, fall back to mongodb toolchain if it has Python 3.9 +.
50+ if [ -f " /opt/python/3.9 /bin/python3" ]; then
51+ PYTHON=" /opt/python/3.9 /bin/python3"
52+ elif is_python_39 " $( command -v /opt/mongodbtoolchain/v4/bin/python3) " ; then
5353 PYTHON=" /opt/mongodbtoolchain/v4/bin/python3"
54- elif is_python_310 " $( command -v /opt/mongodbtoolchain/v3/bin/python3) " ; then
54+ elif is_python_39 " $( command -v /opt/mongodbtoolchain/v3/bin/python3) " ; then
5555 PYTHON=" /opt/mongodbtoolchain/v3/bin/python3"
5656 fi
5757 fi
5858 if [ -z " $PYTHON " ]; then
59- echo " Cannot run pre-commit without python3.10 + installed!"
59+ echo " Cannot run pre-commit without python3.9 + installed!"
6060 exit 1
6161 fi
6262 echo " $PYTHON "
6363}
6464
65- # Function that returns success if the provided Python binary is version 3.10 or later
65+ # Function that returns success if the provided Python binary is version 3.9 or later
6666# Usage:
67- # is_python_310 /path/to/python
67+ # is_python_39 /path/to/python
6868# * param1: Python binary
69- is_python_310 () {
69+ is_python_39 () {
7070 if [ -z " $1 " ]; then
7171 return 1
7272 elif $1 -c " import sys; exit(sys.version_info[:2] < (3, 10))" ; then
0 commit comments