[pypy-commit] pypy py3k: fix keyword argument for str(object=)

amauryfa noreply at buildbot.pypy.org
Sun Dec 18 19:34:27 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r50669:1aa5643d7e26
Date: 2011-12-18 17:16 +0100
http://bitbucket.org/pypy/pypy/changeset/1aa5643d7e26/

Log:	fix keyword argument for str(object=)

diff --git a/pypy/objspace/std/test/test_unicodeobject.py b/pypy/objspace/std/test/test_unicodeobject.py
--- a/pypy/objspace/std/test/test_unicodeobject.py
+++ b/pypy/objspace/std/test/test_unicodeobject.py
@@ -283,6 +283,7 @@
         assert str() == ''
         assert str(None) == 'None'
         assert str(123) == '123'
+        assert str(object=123) == '123'
         assert str([2, 3]) == '[2, 3]'
         class U(str):
             pass
diff --git a/pypy/objspace/std/unicodetype.py b/pypy/objspace/std/unicodetype.py
--- a/pypy/objspace/std/unicodetype.py
+++ b/pypy/objspace/std/unicodetype.py
@@ -292,12 +292,12 @@
         raise OperationError(space.w_TypeError, space.wrap(msg))
     return w_res
 
-def descr_new_(space, w_unicodetype, w_string=u'', w_encoding=None, w_errors=None):
+def descr_new_(space, w_unicodetype, w_object=u'', w_encoding=None, w_errors=None):
     # NB. the default value of w_obj is really a *wrapped* empty string:
     #     there is gateway magic at work
     from pypy.objspace.std.unicodeobject import W_UnicodeObject
     from pypy.objspace.std.ropeunicodeobject import W_RopeUnicodeObject
-    w_obj = w_string
+    w_obj = w_object
 
     encoding, errors = _get_encoding_and_errors(space, w_encoding, w_errors)
     # convoluted logic for the case when unicode subclass has a __unicode__


More information about the pypy-commit mailing list