Blame SOURCES/journalling-import-check.patch

e965a0
From 59f7e0b123fc9789538f610a89d350d76c35106b Mon Sep 17 00:00:00 2001
e965a0
From: Jakub Heger <jheger@redhat.com>
e965a0
Date: Wed, 22 Aug 2018 12:37:49 +0200
e965a0
Subject: [PATCH 2/4] journalling: try import
e965a0
e965a0
imports are now in try block, exceptions cause unsuccessful exit with
e965a0
error message printed
e965a0
---
e965a0
 src/python/journalling.py | 20 ++++++++++++--------
e965a0
 1 file changed, 12 insertions(+), 8 deletions(-)
e965a0
e965a0
diff --git a/src/python/journalling.py b/src/python/journalling.py
e965a0
index 220d5d2..7a65d78 100755
e965a0
--- a/src/python/journalling.py
e965a0
+++ b/src/python/journalling.py
e965a0
@@ -23,14 +23,18 @@
e965a0
 # TODO fix xml pretty print
e965a0
e965a0
e965a0
-import os
e965a0
-import re
e965a0
-import sys
e965a0
-import six
e965a0
-import time
e965a0
-import base64
e965a0
-from lxml import etree
e965a0
-from optparse import OptionParser
e965a0
+try:
e965a0
+    import os
e965a0
+    import re
e965a0
+    import sys
e965a0
+    import six
e965a0
+    import time
e965a0
+    import base64
e965a0
+    from lxml import etree
e965a0
+    from optparse import OptionParser
e965a0
+except ImportError as e:
e965a0
+    sys.stderr.write("Python ImportError: " + str(e) + "\nExiting unsuccessfully.\n")
e965a0
+    exit(1)
e965a0
e965a0
e965a0
 xmlForbidden = [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 14, 15, 16, 17, 18, 19, 20,
e965a0
--
e965a0
2.17.1