--- /dev/null
+Return-Path: <bremner@tesseract.cs.unb.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 9D0426DE15BE\r
+ for <notmuch@notmuchmail.org>; Sat, 23 May 2015 13:30:42 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.284\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.284 tagged_above=-999 required=5 tests=[AWL=0.274, \r
+ T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id hfKtf6S2jyNh for <notmuch@notmuchmail.org>;\r
+ Sat, 23 May 2015 13:30:38 -0700 (PDT)\r
+Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net\r
+ [87.98.215.224])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 1BBE56DE147C\r
+ for <notmuch@notmuchmail.org>; Sat, 23 May 2015 13:30:38 -0700 (PDT)\r
+Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim\r
+ 4.80) (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+ id 1YwG3P-0002qV-UM; Sat, 23 May 2015 20:29:55 +0000\r
+Received: (nullmailer pid 8765 invoked by uid 1000); Sat, 23 May 2015\r
+ 20:29:05 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/4] test: use the python interpreter in sh.configure\r
+Date: Sat, 23 May 2015 22:28:46 +0200\r
+Message-Id: <1432412927-8373-4-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <1432412927-8373-1-git-send-email-david@tethera.net>\r
+References: <1432412927-8373-1-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 23 May 2015 20:30:42 -0000\r
+\r
+The configure script chooses "python" if it exists, so this could\r
+change the version of python used to run the test suite.\r
+---\r
+ configure | 2 ++\r
+ test/test-lib.sh | 14 +++-----------\r
+ 2 files changed, 5 insertions(+), 11 deletions(-)\r
+\r
+diff --git a/configure b/configure\r
+index 71eef6c..1081061 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -111,6 +111,8 @@ Other environment variables can be used to control configure itself,\r
+ XAPIAN_CONFIG The program to use to determine flags for\r
+ compiling and linking against the Xapian\r
+ library. [$XAPIAN_CONFIG]\r
++ PYTHON Name of python command to use in\r
++ configure and the test suite.\r
+ \r
+ Additionally, various options can be specified on the configure\r
+ command line.\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index 486d1c4..9b63a7a 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -621,9 +621,9 @@ test_expect_equal_json () {\r
+ # The test suite forces LC_ALL=C, but this causes Python 3 to\r
+ # decode stdin as ASCII. We need to read JSON in UTF-8, so\r
+ # override Python's stdio encoding defaults.\r
+- output=$(echo "$1" | PYTHONIOENCODING=utf-8 python -mjson.tool \\r
++ output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool \\r
+ || echo "$1")\r
+- expected=$(echo "$2" | PYTHONIOENCODING=utf-8 python -mjson.tool \\r
++ expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -mjson.tool \\r
+ || echo "$2")\r
+ shift 2\r
+ test_expect_equal "$output" "$expected" "$@"\r
+@@ -1153,14 +1153,8 @@ test_python() {\r
+ export LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib\r
+ export PYTHONPATH=$TEST_DIRECTORY/../bindings/python\r
+ \r
+- # Some distros (e.g. Arch Linux) ship Python 2.* as /usr/bin/python2,\r
+- # most others as /usr/bin/python. So first try python2, and fallback to\r
+- # python if python2 doesn't exist.\r
+- cmd=python2\r
+- [[ ${test_missing_external_prereq_[python2]} == t ]] && cmd=python\r
+-\r
+ (echo "import sys; _orig_stdout=sys.stdout; sys.stdout=open('OUTPUT', 'w')"; cat) \\r
+- | $cmd -\r
++ | $NOTMUCH_PYTHON -\r
+ }\r
+ \r
+ test_C () {\r
+@@ -1320,5 +1314,3 @@ test_declare_external_prereq emacs\r
+ test_declare_external_prereq ${TEST_EMACSCLIENT}\r
+ test_declare_external_prereq gdb\r
+ test_declare_external_prereq gpg\r
+-test_declare_external_prereq python\r
+-test_declare_external_prereq python2\r
+-- \r
+2.1.4\r
+\r