__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 ):
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'):
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])