[pypy-commit] pypy space-newtext: pwd
cfbolz
pypy.commits at gmail.com
Thu Nov 3 11:46:08 EDT 2016
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: space-newtext
Changeset: r88126:7cdb0a7ebd3a
Date: 2016-11-03 16:13 +0100
http://bitbucket.org/pypy/pypy/changeset/7cdb0a7ebd3a/
Log: pwd
diff --git a/pypy/module/pwd/interp_pwd.py b/pypy/module/pwd/interp_pwd.py
--- a/pypy/module/pwd/interp_pwd.py
+++ b/pypy/module/pwd/interp_pwd.py
@@ -73,15 +73,15 @@
def make_struct_passwd(space, pw):
w_passwd_struct = space.getattr(space.getbuiltinmodule('pwd'),
- space.wrap('struct_passwd'))
+ space.newtext('struct_passwd'))
w_tuple = space.newtuple([
- space.wrap(rffi.charp2str(pw.c_pw_name)),
- space.wrap(rffi.charp2str(pw.c_pw_passwd)),
- space.int(space.wrap(pw.c_pw_uid)),
- space.int(space.wrap(pw.c_pw_gid)),
- space.wrap(rffi.charp2str(pw.c_pw_gecos)),
- space.wrap(rffi.charp2str(pw.c_pw_dir)),
- space.wrap(rffi.charp2str(pw.c_pw_shell)),
+ space.newtext(rffi.charp2str(pw.c_pw_name)),
+ space.newtext(rffi.charp2str(pw.c_pw_passwd)),
+ space.int(space.newint(pw.c_pw_uid)),
+ space.int(space.newint(pw.c_pw_gid)),
+ space.newtext(rffi.charp2str(pw.c_pw_gecos)),
+ space.newtext(rffi.charp2str(pw.c_pw_dir)),
+ space.newtext(rffi.charp2str(pw.c_pw_shell)),
])
return space.call_function(w_passwd_struct, w_tuple)
@@ -102,7 +102,7 @@
raise
pw = c_getpwuid(uid)
if not pw:
- raise OperationError(space.w_KeyError, space.wrap(
+ raise OperationError(space.w_KeyError, space.newtext(
"%s: %d" % (msg, widen(uid))))
return make_struct_passwd(space, pw)
More information about the pypy-commit
mailing list