def _runscript(scriptname, sandbox=False):
 namespace = {'__name__': '__main__'}
 namespace['sys'] = globals()['sys']
 try:
  pkg_resources.get_distribution('khmer').run_script(scriptname, namespace)
  return 0
 except pkg_resources.ResolutionError:
  pass
 if sandbox:
  path = os.path.join(os.path.dirname(__file__), '../sandbox')
 else:
  path = scriptpath()
 scriptfile = os.path.join(path, scriptname)
 if os.path.isfile(scriptfile):
  if os.path.isfile(scriptfile):
   exec compile(open(scriptfile).read(), scriptfile, 'exec') in namespace
   return 0
 elif sandbox:
  pytest.skip('sandbox tests are only run in a repository.')
 return (-1)

def _runscript ( scriptname , sandbox = False ) : namespace = { '__name__' : '__main__' } namespace [ 'sys' ] = globals ( ) [ 'sys' ] try : pkg_resources . get_distribution ( 'khmer' ) . run_script ( scriptname , namespace ) return 0 except pkg_resources . ResolutionError : pass if sandbox : path = os . path . join ( os . path . dirname ( __file__ ) , '../sandbox' ) else : path = scriptpath ( ) scriptfile = os . path . join ( path , scriptname ) if os . path . isfile ( scriptfile ) : if os . path . isfile ( scriptfile ) : exec compile ( open ( scriptfile ) . read ( ) , scriptfile , 'exec' ) in namespace return 0 elif sandbox : pytest . skip ( 'sandbox tests are only run in a repository.' ) return ( - 1 )
find & run a script with exec .