From 75dcb906219fd2f24ef827e3d758a84125387b5d Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Wed, 10 Jan 2018 16:33:03 -0800 Subject: [PATCH] Niceties: when environment variable overload is used clarify we're not checking the PATH --- ocrmypdf/exec/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ocrmypdf/exec/__init__.py b/ocrmypdf/exec/__init__.py index 2a5c63af..5a9e48aa 100644 --- a/ocrmypdf/exec/__init__.py +++ b/ocrmypdf/exec/__init__.py @@ -29,8 +29,14 @@ def get_version(program, *, stdout=PIPE, stderr=STDOUT, check=True) output = proc.stdout except CalledProcessError as e: - raise MissingDependencyError( - "Could not find program '{}' on the PATH".format(program)) from e + if get_program(program) == program: + raise MissingDependencyError( + "Could not find program '{}' on the PATH".format( + program)) from e + else: + raise MissingDependencyError( + "Could not find program '{}'".format( + get_program(program))) from e try: version = re.match(regex, output.strip()).group(1)