From ef9e07c6d0ba186b52dc5cd6cc3ff83d62602204 Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Mon, 17 Aug 2015 21:00:03 -0400 Subject: [PATCH] Detect multiple python versions --- unittests | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/unittests b/unittests index feefd9d..f9f7224 100755 --- a/unittests +++ b/unittests @@ -7,13 +7,14 @@ mkdir -p $tmp # trap "rm -rf $tmp" EXIT INT QUIT +ver=$(python -c 'import sys; print("%d.%d" % sys.version_info[:2])') python setup.py build # So *always* use the in-tree version of configtools here. # prefix better be right at this point -if [[ ! -f build/scripts-2.7/getconf.py ]] +if [[ ! -f build/scripts-$ver/getconf.py ]] then - echo "Cannot find getconf.py: build/scripts-2.7/getconf.py" 1>&2 + echo "Cannot find getconf.py: build/scripts-$ver/getconf.py" 1>&2 exit 1 fi @@ -26,7 +27,7 @@ ppathins() { export PYTHONPATH ppathins $PWD/build/lib -bin=$PWD/build/scripts-2.7 +bin=$PWD/build/scripts-$ver function run_test { testnum=$1