def _os_info():
 lines = []
 releaseinfo = None
 if (sys.platform == 'linux'):
  osver = ''
  releaseinfo = _release_info()
 elif (sys.platform == 'win32'):
  osver = ', '.join(platform.win32_ver())
 elif (sys.platform == 'darwin'):
  (release, versioninfo, machine) = platform.mac_ver()
  if all(((not e) for e in versioninfo)):
   versioninfo = ''
  else:
   versioninfo = '.'.join(versioninfo)
  osver = ', '.join([e for e in [release, versioninfo, machine] if e])
 else:
  osver = '?'
 lines.append('OS Version: {}'.format(osver))
 if (releaseinfo is not None):
  for (fn, data) in releaseinfo:
   lines += ['', '--- {} ---'.format(fn), data]
 return lines

def _os_info ( ) : lines = [ ] releaseinfo = None if ( sys . platform == 'linux' ) : osver = '' releaseinfo = _release_info ( ) elif ( sys . platform == 'win32' ) : osver = ', ' . join ( platform . win32_ver ( ) ) elif ( sys . platform == 'darwin' ) : ( release , versioninfo , machine ) = platform . mac_ver ( ) if all ( ( ( not e ) for e in versioninfo ) ) : versioninfo = '' else : versioninfo = '.' . join ( versioninfo ) osver = ', ' . join ( [ e for e in [ release , versioninfo , machine ] if e ] ) else : osver = '?' lines . append ( 'OS Version: {}' . format ( osver ) ) if ( releaseinfo is not None ) : for ( fn , data ) in releaseinfo : lines += [ '' , '--- {} ---' . format ( fn ) , data ] return lines
get operating system info .