From 9f71dda57add62b97aad159866f6b210cb896444 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 5 Sep 2006 06:14:45 +0000 Subject: [PATCH] PAL13340 : fix launching problem on 64-bit platforms (more correct check) --- bin/runSalome.py | 13 +++++++++---- src/KERNEL_PY/salome_shared_modules.py | 9 +++++---- 2 files changed, 14 insertions(+), 8 deletions(-) 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: -- 2.39.2