summaryrefslogtreecommitdiff
path: root/buildscripts/utils.py
diff options
context:
space:
mode:
authorMathew Robinson <mathew.robinson@mongodb.com>2020-01-16 23:04:43 +0000
committerevergreen <evergreen@mongodb.com>2020-01-16 23:04:43 +0000
commit02f3b3a204bdc0e1b157a3839be91dc56f685077 (patch)
tree578f9728ecbb082dce36169f3cdfacc22b3a8357 /buildscripts/utils.py
parentafca00af8b522304402b4671c7b9888776c0ec5f (diff)
downloadmongo-02f3b3a204bdc0e1b157a3839be91dc56f685077.tar.gz
SERVER-42702 $PYTHON should not be used in build signature
Diffstat (limited to 'buildscripts/utils.py')
-rw-r--r--buildscripts/utils.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/buildscripts/utils.py b/buildscripts/utils.py
index 4e2edcc76e5..8228675d084 100644
--- a/buildscripts/utils.py
+++ b/buildscripts/utils.py
@@ -130,33 +130,6 @@ def which(executable):
return executable
-def find_python(min_version=(3, 7)):
- """Return path of python."""
- try:
- return sys.executable
- except AttributeError:
- # In case the version of Python is somehow missing sys.version_info or sys.executable.
- pass
-
- version = re.compile(r"[Pp]ython ([\d\.]+)", re.MULTILINE)
- binaries = ("python37", "python3.7", "python36", "python3.6", "python35", "python3.5", "python")
- for binary in binaries:
- try:
- out, err = subprocess.Popen([binary, "-V"], stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).communicate()
- for stream in (out, err):
- match = version.search(stream)
- if match:
- versiontuple = tuple(map(int, match.group(1).split(".")))
- if versiontuple >= min_version:
- return which(binary)
- except Exception: # pylint: disable=broad-except
- pass
-
- raise Exception(
- "could not find suitable Python (version >= %s)" % ".".join(str(v) for v in min_version))
-
-
def replace_with_repr(unicode_error):
"""Codec error handler replacement."""
# Unicode is a pain, some strings cannot be unicode()'d