[pypy-commit] pypy memoryview-attributes: can only return a W_Root object to app level (translation issue)
plan_rich
pypy.commits at gmail.com
Mon Aug 22 05:03:31 EDT 2016
Author: Richard Plangger <planrichi at gmail.com>
Branch: memoryview-attributes
Changeset: r86403:5599a214c3e4
Date: 2016-08-22 11:02 +0200
http://bitbucket.org/pypy/pypy/changeset/5599a214c3e4/
Log: can only return a W_Root object to app level (translation issue)
diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -19,6 +19,7 @@
decode_object, unicode_from_encoded_object,
unicode_from_string, getdefaultencoding)
from pypy.objspace.std.util import IDTAG_SPECIAL, IDTAG_SHIFT
+from pypy.objspace.std.strbuf import W_StringBufferObject
class W_AbstractBytesObject(W_Root):
@@ -434,7 +435,6 @@
of the specified width. The string S is never truncated.
"""
-
class W_BytesObject(W_AbstractBytesObject):
import_from_mixin(StringMethods)
_immutable_fields_ = ['_value']
@@ -465,7 +465,7 @@
"Cannot use string as modifiable buffer")
def descr_getbuffer(self, space, w_flags):
- return StringBuffer(self._value)
+ return W_StringBufferObject(StringBuffer(self._value))
charbuf_w = str_w
More information about the pypy-commit
mailing list