]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Minor corrections for particular file and system support
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 11 Oct 2020 10:13:43 +0000 (12:13 +0200)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 11 Oct 2020 10:13:43 +0000 (12:13 +0200)
src/daComposant/daCore/Interfaces.py
src/daComposant/daCore/PlatformInfo.py

index 402557dd083480aa43445b45249c23bdff2118cd..d6098add6669f72d3c51f4d3c86300ba7a1ddf71 100644 (file)
@@ -623,7 +623,10 @@ class ImportFromScript(object):
             __basename = __filename.rstrip(".py")
         PlatformInfo.checkFileNameImportability( __basename+".py" )
         self.__basename = __basename
-        self.__filenspace = __import__(__basename, globals(), locals(), [])
+        try:
+            self.__filenspace = __import__(__basename, globals(), locals(), [])
+        except NameError:
+            self.__filenspace = ""
         with open(__filename,'r') as fid:
             self.__filestring = fid.read()
     def getvalue(self, __varname=None, __synonym=None ):
index fd78c50873f4fc4f8043f000c2312cc06b4a4cad..f08b80a57659ec7b0cbb9007425ef8563e96b5ef 100644 (file)
@@ -93,7 +93,7 @@ class PlatformInfo(object):
             if hasattr(platform, 'linux_distribution'):
                 __msg += "\n%s%30s : %s" %(__prefix,
                     "platform.linux_distribution",str(platform.linux_distribution()))
-            else:
+            elif hasattr(platform, 'dist'):
                 __msg += "\n%s%30s : %s" %(__prefix,"platform.dist",str(platform.dist()))
         elif sys.platform.startswith('darwin'):
             if hasattr(platform, 'mac_ver'):
@@ -104,7 +104,7 @@ class PlatformInfo(object):
                     if (platform.mac_ver()[0].split('.')[1] == key):
                         __msg += "\n%s%30s : %s" %(__prefix,
                             "platform.mac_ver",str(platform.mac_ver()[0]+"(" + macosx_dict[key]+")"))
-            else:
+            elif hasattr(platform, 'dist'):
                 __msg += "\n%s%30s : %s" %(__prefix,"platform.dist",str(platform.dist()))
         elif os.name == 'nt':
             __msg += "\n%s%30s : %s" %(__prefix,"platform.win32_ver",platform.win32_ver()[1])