[pypy-svn] pypy bytearray: (mfoord) create data for bytearray correctly in bytearray.splitlines

mfoord commits-noreply at bitbucket.org
Fri Jan 21 17:55:38 CET 2011


Author: Michael Foord <michael at voidspace.org.uk>
Branch: bytearray
Changeset: r41168:b8f66792d795
Date: 2011-01-21 17:55 +0100
http://bitbucket.org/pypy/pypy/changeset/b8f66792d795/

Log:	(mfoord) create data for bytearray correctly in bytearray.splitlines

diff --git a/pypy/objspace/std/bytearrayobject.py b/pypy/objspace/std/bytearrayobject.py
--- a/pypy/objspace/std/bytearrayobject.py
+++ b/pypy/objspace/std/bytearrayobject.py
@@ -533,8 +533,10 @@
 def str_splitlines__Bytearray_ANY(space, w_bytearray, w_keepends):
     w_str = str__Bytearray(space, w_bytearray)
     w_result = stringobject.str_splitlines__String_ANY(space, w_str, w_keepends)
-    return space.newlist([new_bytearray(space, space.w_bytearray, space.str_w(entry))
-                          for entry in space.unpackiterable(w_result)])
+    return space.newlist([
+        new_bytearray(space, space.w_bytearray, makebytearraydata_w(space, w_entry))
+                        for w_entry in space.unpackiterable(w_result)
+    ])
 
 def str_split__Bytearray_ANY_ANY(space, w_bytearray, w_by, w_maxsplit=-1):
     w_str = str__Bytearray(space, w_bytearray)


More information about the Pypy-commit mailing list