Beispiel #1
0
 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])
Beispiel #2
0
 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])
Beispiel #3
0
 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])
Beispiel #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
Beispiel #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)
Beispiel #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
Beispiel #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)