From 3185830e3afaa238d0c79220fcefea8800b8cf85 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Mon, 25 Nov 2019 20:47:24 -0400 Subject: [PATCH] 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')