From: vsr Date: Tue, 5 Sep 2006 06:14:45 +0000 (+0000) Subject: PAL13340 : fix launching problem on 64-bit platforms (more correct check) X-Git-Tag: For_GUI_AutoTools~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9f71dda57add62b97aad159866f6b210cb896444;p=modules%2Fkernel.git PAL13340 : fix launching problem on 64-bit platforms (more correct check) --- diff --git a/bin/runSalome.py b/bin/runSalome.py index 485140e0e..6e7e6788b 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -55,11 +55,16 @@ def add_path(directory, variable_name): # ----------------------------------------------------------------------------- +__lib__dir__ = None def get_lib_dir(): - import platform, re - if re.match(".*64.*", platform.machine()): - return "lib64" - return "lib" + global __lib__dir__ + if __lib__dir__: return __lib__dir__ + import platform + if platform.architecture()[0] == "64bit": + __lib__dir__ = "lib64" + else: + __lib__dir__ = "lib" + return get_lib_dir() # ----------------------------------------------------------------------------- diff --git a/src/KERNEL_PY/salome_shared_modules.py b/src/KERNEL_PY/salome_shared_modules.py index a86c155ab..2222a4d9e 100755 --- a/src/KERNEL_PY/salome_shared_modules.py +++ b/src/KERNEL_PY/salome_shared_modules.py @@ -75,11 +75,12 @@ list_modules=[] # Import all *_shared_modules in the path and store them in list_modules path=salome_path.split(":") -for rep in path: - import platform, re +import platform +if platform.architecture()[0] == "64bit": + libdir = "lib64" +else: libdir = "lib" - if re.match(".*64.*", platform.machine()): - libdir = "lib64" +for rep in path: # Import all *_shared_modules in rep for f in glob.glob(os.path.join(rep,libdir,"python"+sys.version[:3],"site-packages","salome","shared_modules","*_shared_modules.py")): try: