[pypy-svn] pypy bytearray: (mfoord) change way unicode characters are iterated over in buffer constructor for sake of the annotator

mfoord commits-noreply at bitbucket.org
Sat Jan 22 13:05:47 CET 2011


Author: Michael Foord <michael at voidspace.org.uk>
Branch: bytearray
Changeset: r41215:cc1d6c1c3ca4
Date: 2011-01-22 13:05 +0100
http://bitbucket.org/pypy/pypy/changeset/cc1d6c1c3ca4/

Log:	(mfoord) change way unicode characters are iterated over in buffer
	constructor for sake of the annotator

diff --git a/pypy/interpreter/buffer.py b/pypy/interpreter/buffer.py
--- a/pypy/interpreter/buffer.py
+++ b/pypy/interpreter/buffer.py
@@ -162,7 +162,7 @@
         # but not the new buffer interface (change in python  2.7)
         from pypy.rlib.rstruct.unichar import pack_unichar
         charlist = []
-        for unich in w_object._value:
+        for unich in space.unicode_w(w_object):
             pack_unichar(unich, charlist)
         from pypy.interpreter.buffer import StringBuffer
         w_buffer = space.wrap(StringBuffer(''.join(charlist)))


More information about the Pypy-commit mailing list