Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r84839:58a29d4ff2ab
Date: 2016-05-30 15:34 -0700
http://bitbucket.org/pypy/pypy/changeset/58a29d4ff2ab/
Log: use wrap_fsdecoded
diff --git a/pypy/module/sys/initpath.py b/pypy/module/sys/initpath.py
--- a/pypy/module/sys/initpath.py
+++ b/pypy/module/sys/initpath.py
@@ -115,7 +115,7 @@
if state is not None: # 'None' for testing only
lib_extensions = os.path.join(lib_pypy, '__extensions__')
- state.w_lib_extensions = _w_fsdecode(state.space, lib_extensions)
+ state.w_lib_extensions = state.space.wrap_fsdecoded(lib_extensions)
importlist.append(lib_extensions)
importlist.append(lib_pypy)
@@ -147,12 +147,12 @@
@unwrap_spec(executable='fsencode')
def pypy_find_executable(space, executable):
- return _w_fsdecode(space, find_executable(executable))
+ return space.wrap_fsdecoded(find_executable(executable))
@unwrap_spec(filename='fsencode')
def pypy_resolvedirof(space, filename):
- return _w_fsdecode(space, resolvedirof(filename))
+ return space.wrap_fsdecoded(resolvedirof(filename))
@unwrap_spec(executable='fsencode')
@@ -160,16 +160,12 @@
path, prefix = find_stdlib(get_state(space), executable)
if path is None:
return space.w_None
- w_prefix = _w_fsdecode(space, prefix)
+ w_prefix = space.wrap_fsdecoded(prefix)
space.setitem(space.sys.w_dict, space.wrap('prefix'), w_prefix)
space.setitem(space.sys.w_dict, space.wrap('exec_prefix'), w_prefix)
space.setitem(space.sys.w_dict, space.wrap('base_prefix'), w_prefix)
space.setitem(space.sys.w_dict, space.wrap('base_exec_prefix'), w_prefix)
- return space.newlist([_w_fsdecode(space, p) for p in path])
+ return space.newlist([space.wrap_fsdecoded(p) for p in path])
def pypy_initfsencoding(space):
space.sys.filesystemencoding = _getfilesystemencoding(space)
-
-
-def _w_fsdecode(space, b):
- return space.fsdecode(space.wrapbytes(b))
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit