From: akl Date: Tue, 23 Dec 2008 12:13:12 +0000 (+0000) Subject: To print user friendly message at Python modules import error. X-Git-Tag: V4_1_4sp2~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ef5006744cfcfa52c1df6129ebf4c583c3f972a7;p=tools%2Finstall.git To print user friendly message at Python modules import error. --- diff --git a/runInstall b/runInstall index bb73012..3f82079 100755 --- a/runInstall +++ b/runInstall @@ -12,16 +12,21 @@ Copyright : 2002-2008 CEA __version__ = "1.1.5" +# --- imports --- # +import sys +try: + import xml.sax, xml.dom.minidom + import os, re + import types + import random + import warnings +except Exception, an_exc: + sys.exit("Error: %s! Please check the installed Python package." % str(an_exc)) + pass + # --- avoid "deprecation" warnings --- # -import warnings warnings.filterwarnings("ignore", "", DeprecationWarning) -# --- imports --- # -import xml.sax, xml.dom.minidom -import sys, os, re -import types -import random - # --- global variables --- # opt_parser = None root_path = None