示例#1
0
def pypy_find_stdlib(space, executable):
    path, prefix = find_stdlib(get_state(space), executable)
    if path is None:
        return space.w_None
    w_prefix = space.wrap(prefix)
    space.setitem(space.sys.w_dict, space.wrap('prefix'), w_prefix)
    space.setitem(space.sys.w_dict, space.wrap('exec_prefix'), w_prefix)
    return space.newlist([space.wrap(p) for p in path])
示例#2
0
def pypy_find_stdlib(space, executable):
    path, prefix = None, None
    if executable != '*':
        path, prefix = find_stdlib(get_state(space), executable)
    if path is None:
        if space.config.translation.shared:
            dynamic_location = pypy_init_home()
            if dynamic_location:
                dyn_path = rffi.charp2str(dynamic_location)
                pypy_init_free(dynamic_location)
                path, prefix = find_stdlib(get_state(space), dyn_path)
        if path is None:
            return space.w_None
    w_prefix = space.newtext(prefix)
    space.setitem(space.sys.w_dict, space.newtext('prefix'), w_prefix)
    space.setitem(space.sys.w_dict, space.newtext('exec_prefix'), w_prefix)
    return space.newlist([space.newtext(p) for p in path])
示例#3
0
文件: initpath.py 项目: yuyichao/pypy
def pypy_find_stdlib(space, executable):
    path, prefix = find_stdlib(get_state(space), executable)
    if path is None:
        return space.w_None
    w_prefix = space.wrap(prefix)
    space.setitem(space.sys.w_dict, space.wrap('prefix'), w_prefix)
    space.setitem(space.sys.w_dict, space.wrap('exec_prefix'), w_prefix)
    return space.newlist([space.wrap(p) for p in path])
示例#4
0
def pypy_find_stdlib(space, executable):
    path, prefix = None, None
    if executable != '*':
        path, prefix = find_stdlib(get_state(space), executable)
    if path is None:
        if space.config.translation.shared:
            dynamic_location = pypy_init_home()
            if dynamic_location:
                dyn_path = rffi.charp2str(dynamic_location)
                pypy_init_free(dynamic_location)
                path, prefix = find_stdlib(get_state(space), dyn_path)
        if path is None:
            return space.w_None
    w_prefix = space.wrap(prefix)
    space.setitem(space.sys.w_dict, space.wrap('prefix'), w_prefix)
    space.setitem(space.sys.w_dict, space.wrap('exec_prefix'), w_prefix)
    return space.newlist([space.wrap(p) for p in path])