From: David Bremner Date: Tue, 26 Nov 2019 00:47:24 +0000 (-0400) Subject: python-cffi: use shutil.which X-Git-Tag: archive/debian/0.30_rc0-1~118 X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;ds=sidebyside;h=3185830e3afaa238d0c79220fcefea8800b8cf85;p=notmuch 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')