def setinitialpath(self, space): from pypy.module.sys.initpath import compute_stdlib_path # Initialize the default path pypydir = os.path.dirname(os.path.abspath(pypy.__file__)) srcdir = os.path.dirname(pypydir) path = compute_stdlib_path(self, srcdir) self.w_path = space.newlist([space.wrap(p) for p in path])
def setinitialpath(self, space): from pypy.module.sys.initpath import compute_stdlib_path # This initial value for sys.prefix is normally overwritten # at runtime by initpath.py srcdir = os.path.dirname(pypydir) self.w_initial_prefix = space.newtext(srcdir) # Initialize the default path path = compute_stdlib_path(self, srcdir) self.w_path = space.newlist([space.newtext(p) for p in path])
def test_include_libtk(tmpdir): lib_pypy, lib_python = build_hierarchy(tmpdir) lib_tk = lib_python.join('lib-tk') path = compute_stdlib_path(None, str(tmpdir)) assert lib_tk in path
def test_compute_stdlib_path(tmpdir): dirs = build_hierarchy(tmpdir) path = compute_stdlib_path(None, str(tmpdir)) # we get at least 'dirs', and maybe more (e.g. plat-linux2) assert path[:len(dirs)] == map(str, dirs)