def safe_scan(path, python):
 myself = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'pybinary.py')
 proc = TimedPopen(cmd=('%s %s %s' % (python, myself, path)), env=dict(PYTHONPATH=os.pathsep.join(sys.path)))
 (out, err) = proc.communicate()
 if err:
  raise BinaryScanError(err)
 return out

def safe_scan ( path , python ) : myself = os . path . join ( os . path . dirname ( os . path . abspath ( __file__ ) ) , 'pybinary.py' ) proc = TimedPopen ( cmd = ( '%s %s %s' % ( python , myself , path ) ) , env = dict ( PYTHONPATH = os . pathsep . join ( sys . path ) ) ) ( out , err ) = proc . communicate ( ) if err : raise BinaryScanError ( err ) return out
performs a "safe" out-of-process scan .