git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Make sure we use compat/subprocess.py with Python 2.3 while running tests.

From
Junio C Hamano <junkio@cox.net>
Date
Dec 8, 2005, 06:07 UTC
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 <junkio@cox.net>
---
  Junio C Hamano <junkio@cox.net> writes:
  > Mark Allen <mrallen1@yahoo.com> 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
Previous: Junio C HamanoNext: Mark Allen
Message 5 of 6 in “Failure in t6021 on Red Hat Enterprise Linux 4”
  1. Mark AllenDec 7, 2005
  2. Junio C HamanoDec 7, 2005
  3. Mark AllenDec 7, 2005
  4. Junio C HamanoDec 7, 2005
  5. Make sure we use compat/subprocess.py with Python 2.3 while running tests.Junio C Hamano, Dec 8, 2005
  6. Mark AllenDec 8, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.