--- platform.py 2008-06-11 14:25:29.000000000 -0700 +++ pnew.py 2008-06-11 15:43:00.000000000 -0700 @@ -1090,6 +1090,8 @@ """ global _uname_cache + attribute_error = 0 + unknown = 0 if _uname_cache is not None: return _uname_cache @@ -1097,14 +1099,38 @@ # Get some infos from the builtin os.uname API... try: system,node,release,version,machine = os.uname() - + except AttributeError: - # Hmm, no uname... we'll have to poke around the system then. - system = sys.platform + attribute_error = 1 + + # + if system == 'unknown': + system = sys.platform + unknown = 1 + if node == 'unknown': + node = _node() + unknown = 1 + if release == 'unknown': release = '' + unknown = 1 + if version == 'unkown': version = '' - node = _node() - machine = '' + unknown = 1 + if machine == 'unknown': + machine = '' + unknown = 1 + + + if attribute_error or unknown: + # Hmm, no there is either no uname or uname has returned + #'unknowns'... we'll have to poke around the system then. + if attribute_error: + system = sys.platform + release = '' + version = '' + node = _node() + machine = '' + processor = '' use_syscmd_ver = 1 @@ -1160,7 +1186,7 @@ release,(version,stage,nonrel),machine = mac_ver() system = 'MacOS' - else: + if not attribute_error: # System specific extensions if system == 'OpenVMS': # OpenVMS seems to have release and version mixed up @@ -1181,9 +1207,8 @@ else: # Get processor information from the uname system command processor = _syscmd_uname('-p','') - - # 'unknown' is not really any useful as information; we'll convert - # it to '' which is more portable + + #If any unknowns still exist, replace them with ''s, which are more portable if system == 'unknown': system = '' if node == 'unknown':