Blame SOURCES/dblatex-0.3.11-which-shutil.patch

14560c
From af5dc6ec530b107a4a0bd6ac9b2e80b0e7d36077 Mon Sep 17 00:00:00 2001
14560c
Message-Id: <af5dc6ec530b107a4a0bd6ac9b2e80b0e7d36077.1569226914.git.github@grubix.eu>
14560c
In-Reply-To: <49b85799a8f0674ac5eb6f2dfc37b23208d9754a.1569226914.git.github@grubix.eu>
14560c
References: <49b85799a8f0674ac5eb6f2dfc37b23208d9754a.1569226914.git.github@grubix.eu>
14560c
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
14560c
Date: Tue, 26 Jun 2018 17:41:19 +0200
14560c
Subject: [PATCH 13/13] Use which from shutil
14560c
14560c
Signed-off-by: Michael J Gruber <github@grubix.eu>
14560c
---
14560c
 setup.py | 10 ++++------
14560c
 1 file changed, 4 insertions(+), 6 deletions(-)
14560c
14560c
diff --git a/setup.py b/setup.py
14560c
index 86619ec..799c1d2 100644
14560c
--- a/setup.py
14560c
+++ b/setup.py
14560c
@@ -208,17 +208,15 @@ class Build(build):
14560c
 
14560c
 
14560c
 def find_programs(utils):
14560c
-    sys.path.append("lib")
14560c
-    from contrib.which import which
14560c
+    import shutil
14560c
     util_paths = {}
14560c
     missed = []
14560c
     for util in utils:
14560c
-        try:
14560c
-            path = which.which(util)
14560c
+        path = shutil.which(util)
14560c
+        if path:
14560c
             util_paths[util] = path
14560c
-        except which.WhichError:
14560c
+        else:
14560c
             missed.append(util)
14560c
-    sys.path.remove("lib")
14560c
     return (util_paths, missed)
14560c
 
14560c
 def kpsewhich(tex_file):
14560c
-- 
14560c
2.23.0.369.g5d0cb2d495
14560c