From: Junio C Hamano Date: Thu, 08 Dec 2005 06:07:39 GMT Subject: [PATCH] Make sure we use compat/subprocess.py with Python 2.3 while running tests. Message-ID: <7vr78oktp0.fsf_-_@assigned-by-dhcp.cox.net> In-Reply-To: <7vslt4rb4v.fsf@assigned-by-dhcp.cox.net> Otherwise the test will not succeed without installing. Signed-off-by: Junio C Hamano --- Junio C Hamano writes: > Mark Allen writes: > >> So, basically the problem is that the subprocess.py module is >> in the compat directory, and by default (I think).. > > Ah, you are right. > > Just like we fix PATH and GIT_EXEC_PATH during the test > execution, we need to do something with PYTHONPATH environment > variable (this one is _without_ underscore), I think. This seems to fix it for me. t/test-lib.sh | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) 49ccb0877f64308662669a09db7b221419c13d0a diff --git a/t/test-lib.sh b/t/test-lib.sh index f2eccd7..0539dac 100755 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -172,7 +172,18 @@ test_done () { # t/ subdirectory and are run in trash subdirectory. PATH=$(pwd)/..:$PATH GIT_EXEC_PATH=$(pwd)/.. -export GIT_EXEC_PATH +export PATH GIT_EXEC_PATH + +# Similarly use ../compat/subprocess.py if our python does not +# have subprocess.py on its own. +PYTHON=`sed -e '1{ + s/^#!// + q +}' ../git-merge-recursive` && +"$PYTHON" -c 'import subprocess' 2>/dev/null || { + PYTHONPATH=$(pwd)/../compat + export PYTHONPATH +} # Test repository test=trash -- 0.99.9.GIT