示例#1
0
文件: state.py 项目: Qointum/pypy
 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])
示例#2
0
文件: state.py 项目: Qointum/pypy
 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])
示例#3
0
文件: state.py 项目: tools-env/mesapy
 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])
示例#4
0
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
示例#5
0
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)
示例#6
0
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
示例#7
0
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)