def _read_output(commandstring):
 import contextlib
 try:
  import tempfile
  fp = tempfile.NamedTemporaryFile()
 except ImportError:
  fp = open(('/tmp/_osx_support.%s' % (os.getpid(),)), 'w+b')
 with contextlib.closing(fp) as fp:
  cmd = ("%s 2>/dev/null >'%s'" % (commandstring, fp.name))
  return (fp.read().strip() if (not os.system(cmd)) else None)

def _read_output ( commandstring ) : import contextlib try : import tempfile fp = tempfile . NamedTemporaryFile ( ) except ImportError : fp = open ( ( '/tmp/_osx_support.%s' % ( os . getpid ( ) , ) ) , 'w+b' ) with contextlib . closing ( fp ) as fp : cmd = ( "%s 2>/dev/null >'%s'" % ( commandstring , fp . name ) ) return ( fp . read ( ) . strip ( ) if ( not os . system ( cmd ) ) else None )
output from successful command execution or none .