notmuch.git  about / heads / tags
Unnamed repository; edit this file 'description' to name the repository.
   commit 77c1f559e0ffa6a82840fd57bb6f9ca8960414f3 (patch)
   parent 8d1f30cb Move from _add_message to _index_file API
     tree 7c859bf76ea70c1f7ba90f0eae06cd0b1004a979
   author David Bremner <david@tethera.net>  2019-11-25 20:47:24 -0400
committer David Bremner <david@tethera.net>  2019-11-25 20:47:24 -0400

python-cffi: use shutil.which

I was supposed to amend the original patch that added this function,
but somehow I botched that. The original version runs, so make an
extra commit for the tidying.
---
 bindings/python-cffi/tests/conftest.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bindings/python-cffi/tests/conftest.py b/bindings/python-cffi/tests/conftest.py
index 674c7218..e322cc64 100644
--- a/bindings/python-cffi/tests/conftest.py
+++ b/bindings/python-cffi/tests/conftest.py
@@ -1,6 +1,7 @@
 import email.message
 import mailbox
 import pathlib
+import shutil
 import socket
 import subprocess
 import textwrap
@@ -11,10 +12,9 @@ import pytest
 
 
 def pytest_report_header():
+    which = shutil.which('notmuch')
     vers = subprocess.run(['notmuch', '--version'], stdout=subprocess.PIPE)
-    which = subprocess.run(['which', 'notmuch'], stdout=subprocess.PIPE)
-    return ['{} ({})'.format(vers.stdout.decode(errors='replace').strip(),
-                             which.stdout.decode(errors='replace').strip())]
+    return ['{} ({})'.format(vers.stdout.decode(errors='replace').strip(),which)]
 
 
 @pytest.fixture(scope='function')


glossary
--------
Commit objects reference one tree, and zero or more parents.

Single parent commits can typically generate a patch in
unified diff format via `git format-patch'.

Multiple parents means the commit is a merge.

Root commits have no ancestor.  Note that it is
possible to have multiple root commits when merging independent histories.

Every commit references one top-level tree object.

git clone https://yhetil.org/notmuch.git