summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/finish-swig-Python-LLDB.sh
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-04-18 01:37:19 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-04-18 01:37:19 +0000
commitea6037d84eddd9185b5e3eae5ce0675f4e158b36 (patch)
treef3a84a09a1d7bd5730e7190b867caa89f5ab9380 /lldb/scripts/Python/finish-swig-Python-LLDB.sh
parent00d97ea2021f8636acec81146ae7ca50d44c8d0a (diff)
downloadbcm5719-llvm-ea6037d84eddd9185b5e3eae5ce0675f4e158b36.tar.gz
bcm5719-llvm-ea6037d84eddd9185b5e3eae5ce0675f4e158b36.zip
[Shell] Simplify Extracting Python Version
Instead of parsing the Python version with a fairly convoluted regex, just print the major and minor version and call it a day. llvm-svn: 358635
Diffstat (limited to 'lldb/scripts/Python/finish-swig-Python-LLDB.sh')
-rwxr-xr-xlldb/scripts/Python/finish-swig-Python-LLDB.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/lldb/scripts/Python/finish-swig-Python-LLDB.sh b/lldb/scripts/Python/finish-swig-Python-LLDB.sh
index 31bc2b349da..1cd17744a70 100755
--- a/lldb/scripts/Python/finish-swig-Python-LLDB.sh
+++ b/lldb/scripts/Python/finish-swig-Python-LLDB.sh
@@ -56,8 +56,7 @@ fi
OS_NAME=`uname -s`
PYTHON=${PYTHON_EXECUTABLE:-/usr/bin/env python}
-PYTHON_VERSION=`${PYTHON} --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
-
+PYTHON_VERSION=`${PYTHON} -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'`
if [ $Debug -eq 1 ]
then
OpenPOWER on IntegriCloud