From b9b0d7dd9acb535c073cc7fd204f01743d7a680b 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(-) (limited to 'bin') diff --git a/bin/SConsDoc.py b/bin/SConsDoc.py index e1c2b0bb..e435b4a7 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 v1.2.1