[pypy-commit] pypy PyBuffer: fix W_StringBufferObject.buffer_w()

rlamy pypy.commits at gmail.com
Wed Apr 12 20:32:36 EDT 2017


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: PyBuffer
Changeset: r91049:61490339e1fe
Date: 2017-04-13 01:09 +0100
http://bitbucket.org/pypy/pypy/changeset/61490339e1fe/

Log:	fix W_StringBufferObject.buffer_w()

diff --git a/pypy/objspace/std/strbufobject.py b/pypy/objspace/std/strbufobject.py
--- a/pypy/objspace/std/strbufobject.py
+++ b/pypy/objspace/std/strbufobject.py
@@ -2,9 +2,9 @@
 
 import py
 
-from pypy.objspace.std.bytesobject import (W_AbstractBytesObject,
-    W_BytesObject, StringBuffer)
+from pypy.objspace.std.bytesobject import W_AbstractBytesObject, W_BytesObject
 from pypy.interpreter.gateway import interp2app, unwrap_spec
+from pypy.interpreter.buffer import SimpleBuffer, StringBuffer
 from pypy.interpreter.error import OperationError
 from rpython.rlib.rstring import StringBuilder
 
@@ -38,7 +38,7 @@
         return self.force()
 
     def buffer_w(self, space, flags):
-        return StringBuffer(self.force())
+        return SimpleBuffer(StringBuffer(self.force()))
 
     def descr_len(self, space):
         return space.newint(self.length)


More information about the pypy-commit mailing list