From: David Bremner Date: Tue, 26 Nov 2019 00:47:24 +0000 (-0400) Subject: python-cffi: use shutil.which X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=77c1f559e0ffa6a82840fd57bb6f9ca8960414f3;p=notmuch-old 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. --- 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')