[pypy-svn] r74032 - in pypy/branch/rpython-iterator/pypy/objspace/std: . test

fijal at codespeak.net fijal at codespeak.net
Fri Apr 23 20:00:53 CEST 2010


Author: fijal
Date: Fri Apr 23 20:00:51 2010
New Revision: 74032

Modified:
   pypy/branch/rpython-iterator/pypy/objspace/std/test/test_unicodeobject.py
   pypy/branch/rpython-iterator/pypy/objspace/std/unicodeobject.py
Log:
A fix and a test! (untested path)


Modified: pypy/branch/rpython-iterator/pypy/objspace/std/test/test_unicodeobject.py
==============================================================================
--- pypy/branch/rpython-iterator/pypy/objspace/std/test/test_unicodeobject.py	(original)
+++ pypy/branch/rpython-iterator/pypy/objspace/std/test/test_unicodeobject.py	Fri Apr 23 20:00:51 2010
@@ -64,6 +64,7 @@
         check(', '.join([u'a']), u'a')
         check(', '.join(['a', u'b']), u'a, b')
         check(u', '.join(['a', 'b']), u'a, b')
+        raises(TypeError, u'x'.join, [u'x', (1, 2, 3)])
 
     if sys.version_info >= (2,3):
         def test_contains_ex(self):

Modified: pypy/branch/rpython-iterator/pypy/objspace/std/unicodeobject.py
==============================================================================
--- pypy/branch/rpython-iterator/pypy/objspace/std/unicodeobject.py	(original)
+++ pypy/branch/rpython-iterator/pypy/objspace/std/unicodeobject.py	Fri Apr 23 20:00:51 2010
@@ -188,7 +188,9 @@
     #    return l[0]
     
     values_list = []#None] * len(l)
+    i = 0
     for w_item in space.iterate_w(w_list):
+        i += 1
         if isinstance(w_item, W_UnicodeObject):
             # shortcut for performane
             item = w_item._value



More information about the Pypy-commit mailing list