From e6da37d889a747ee19e17b0960f07a4a3d5a4fd8 Mon Sep 17 00:00:00 2001
From: Tamas Gal <tgal@km3net.de>
Date: Wed, 26 Feb 2020 13:05:43 +0100
Subject: [PATCH] Fix sdist generation

---
 setup.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/setup.py b/setup.py
index 2251eca..2a1ffc9 100644
--- a/setup.py
+++ b/setup.py
@@ -22,12 +22,15 @@ class get_pybind_include(object):
 
 def get_root_flags(kind):
     """Retrieve the root flags for kind='inc' or kind'='lib'"""
-    return sp.Popen(["root-config", "--{}dir".format(kind)],
-                    stdout=sp.PIPE).communicate()[0].strip().decode()
+    try:
+        return sp.Popen(["root-config", "--{}dir".format(kind)],
+                        stdout=sp.PIPE).communicate()[0].strip().decode()
+    except OSError:
+        return ""
 
 
 def get_jpp_include():
-    return os.path.join(os.getenv("JPP_DIR"), "software")
+    return os.path.join(os.getenv("JPP_DIR", ""), "software")
 
 
 ext_modules = [
-- 
GitLab