[pypy-commit] pypy default: Fix strbufobject.

Manuel Jacob noreply at buildbot.pypy.org
Sat Jan 18 12:15:53 CET 2014


Author: Manuel Jacob
Branch: 
Changeset: r68761:286528b6716e
Date: 2014-01-18 12:16 +0100
http://bitbucket.org/pypy/pypy/changeset/286528b6716e/

Log:	Fix strbufobject.

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
@@ -633,9 +633,15 @@
             return space.add(self_as_bytearray, w_other)
         if space.config.objspace.std.withstrbuf:
             from pypy.objspace.std.strbufobject import W_StringBufferObject
+            try:
+                other = self._op_val(space, w_other)
+            except OperationError, e:
+                if e.match(space, space.w_TypeError):
+                    return space.w_NotImplemented
+                raise
             builder = StringBuilder()
             builder.append(self._value)
-            builder.append(self._op_val(space, w_other))
+            builder.append(other)
             return W_StringBufferObject(builder)
         return self._StringMethods_descr_add(space, w_other)
 


More information about the pypy-commit mailing list