예제 #1
0
 def run(self, args, env):
     arglist = SDK.runtime() + [self.exe_name] + map(str, args)
     env = env.copy()
     env['LANG'] = 'C'
     mono = subprocess.Popen(arglist, stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE, env=env)
     stdout, stderr = mono.communicate()
     retval = mono.wait()
     return stdout, stderr, retval
예제 #2
0
def load_and_cache_assembly(name, outfile):
    tmpfile = udir.join(name)
    arglist = SDK.runtime() + [Query.get(), name, str(tmpfile)]
    retcode = subprocess.call(arglist)
    assert retcode == 0
    mydict = {}
    execfile(str(tmpfile), mydict)
    types = mydict['types']
    f = outfile.open('wb')
    pickle.dump(types, f, pickle.HIGHEST_PROTOCOL)
    f.close()
    return types
예제 #3
0
파일: query.py 프로젝트: Debug-Orz/Sypy
def load_and_cache_assembly(name, outfile):
    tmpfile = udir.join(name)
    arglist = SDK.runtime() + [Query.get(), name, str(tmpfile)]
    retcode = subprocess.call(arglist)
    assert retcode == 0
    mydict = {}
    execfile(str(tmpfile), mydict)
    types = mydict['types']
    f = outfile.open('wb')
    pickle.dump(types, f, pickle.HIGHEST_PROTOCOL)
    f.close()
    return types
예제 #4
0
파일: runtest.py 프로젝트: ieure/pypy
    def run(self, *args):
        if self._exe is None:
            py.test.skip("Compilation disabled")

        if getoption('norun'):
            py.test.skip("Execution disabled")

        arglist = SDK.runtime() + [self._exe] + map(str, args)
        env = os.environ.copy()
        env['LANG'] = 'C'
        mono = subprocess.Popen(arglist, stdout=subprocess.PIPE,
                                stderr=subprocess.PIPE, env=env)
        stdout, stderr = mono.communicate()
        retval = mono.wait()
        return stdout, stderr, retval
예제 #5
0
    def run(self, *args):
        if self._exe is None:
            py.test.skip("Compilation disabled")

        if getoption('norun'):
            py.test.skip("Execution disabled")

        arglist = SDK.runtime() + [self._exe] + map(str, args)
        env = os.environ.copy()
        env['LANG'] = 'C'
        mono = subprocess.Popen(arglist, stdout=subprocess.PIPE,
                                stderr=subprocess.PIPE, env=env)
        stdout, stderr = mono.communicate()
        retval = mono.wait()
        return stdout, stderr, retval
예제 #6
0
파일: query.py 프로젝트: TheDunn/flex-pypy
def query_description(name):
    log.query('Loading description for %s' % name)
    arglist = SDK.runtime() + [Query.get(), name]
    query = subprocess.Popen(arglist, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                             universal_newlines=True)
    stdout, stderr = query.communicate()
    retval = query.wait()
    if retval == 0:
        cls = ClassDesc()
        exec stdout in cls.__dict__
        del cls.__dict__['__builtins__']
        return cls
    elif retval == 1:
        raise RuntimeError, 'query.exe failed with this message:\n%s' % stderr
    elif retval == 2:
        # can't load type, assume it's a namespace
        return NamespaceDesc(name)