From 2e17a095249dafe84d63309bf5a03b8a9b4961a7 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Sun, 11 Jan 2015 16:23:36 +0300 Subject: SConsDoc.py: Calling sys.exit(-1) in imported library is bad, because it removes the trace who and when imported it. --- bin/SConsDoc.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/SConsDoc.py b/bin/SConsDoc.py index e1c2b0b..e435b4a 100644 --- a/bin/SConsDoc.py +++ b/bin/SConsDoc.py @@ -127,8 +127,7 @@ except: try: import lxml except: - print("Failed to import either libxml2/libxslt or lxml") - sys.exit(1) + raise ImportError("Failed to import either libxml2/libxslt or lxml") has_etree = False if not has_libxml2: @@ -154,8 +153,7 @@ if not has_etree: # normal ElementTree install import elementtree.ElementTree as etree except ImportError: - print("Failed to import ElementTree from any known place") - sys.exit(1) + raise ImportError("Failed to import ElementTree from any known place") re_entity = re.compile("\&([^;]+);") re_entity_header = re.compile("") -- cgit v0.12