@@ -52,7 +52,6 @@ import Data.Char ( toLower, toUpper )
5252import Data.List ( delete, intercalate, isPrefixOf, isSuffixOf, sort )
5353import System.Directory ( getAppUserDataDirectory, findExecutable,
5454 doesFileExist, Permissions(..), getPermissions )
55−import System.Process ( readProcessWithExitCode )
5655import System.IO ( stdout, stderr )
5756import System.IO.Error ( isDoesNotExistError )
5857import qualified Control.Exception as E
@@ -1402,11 +1401,8 @@ convertWithOpts opts args = do
14021401 _ | html5Output -> "wkhtmltopdf"
14031402 _ -> latexEngine
14041403 -- check for pdf creating program
1405− (ec,_,_) <- E.catch
1406− (readProcessWithExitCode pdfprog ["--version"] "")
1407− (\(_ :: E.SomeException) ->
1408− return (ExitFailure 1,"",""))
1409− when (ec /= ExitSuccess) $
1404+ mbPdfProg <- findExecutable pdfprog
1405+ when (isNothing mbPdfProg) $
14101406 err 41 $ pdfprog ++ " not found. " ++
14111407 pdfprog ++ " is needed for pdf output."
14121408