[pypy-commit] pypy py3k: Fix getattr unit tests.

amauryfa noreply at buildbot.pypy.org
Thu Oct 11 00:59:20 CEST 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r57997:4c065fffe139
Date: 2012-10-10 21:57 +0200
http://bitbucket.org/pypy/pypy/changeset/4c065fffe139/

Log:	Fix getattr unit tests.

diff --git a/pypy/module/__builtin__/operation.py b/pypy/module/__builtin__/operation.py
--- a/pypy/module/__builtin__/operation.py
+++ b/pypy/module/__builtin__/operation.py
@@ -50,8 +50,8 @@
     # Note that if w_name is already a string (or a subclass of str),
     # it must be returned unmodified (and not e.g. unwrapped-rewrapped).
     if not space.is_w(space.type(w_name), space.w_text):
-        name = space.str_w(w_name)    # typecheck
-        w_name = space.wrap(name)     # rewrap as a real string
+        name = space.unicode_w(w_name)  # typecheck
+        w_name = space.wrap(name)  # rewrap as a real string
     return w_name
 
 def delattr(space, w_object, w_name):


More information about the pypy-commit mailing list