aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2017-05-26 16:38:27 +0300
committerMatti Picus <matti.picus@gmail.com>2017-05-26 16:38:27 +0300
commit67b49120d961716aa9e7e353addf365af554dc9c (patch)
tree17f2510f08224cc7ac5d85f7b69153abb6b75393
parentmore places to convert hash value -1 to -2, see comments to issue #2346 (diff)
downloadpypy-67b49120d961716aa9e7e353addf365af554dc9c.tar.gz
pypy-67b49120d961716aa9e7e353addf365af554dc9c.tar.bz2
pypy-67b49120d961716aa9e7e353addf365af554dc9c.zip
do not go through descroperation.binop_impl again, call descr_add directly
-rw-r--r--pypy/objspace/std/bytesobject.py2
-rw-r--r--pypy/objspace/std/test/test_bytesobject.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
index c36b53e3d9..9d7c183ddc 100644
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -648,7 +648,7 @@ class W_BytesObject(W_AbstractBytesObject):
if space.isinstance_w(w_other, space.w_unicode):
self_as_unicode = unicode_from_encoded_object(space, self, None,
None)
- return space.add(self_as_unicode, w_other)
+ return self_as_unicode.descr_add(space, w_other)
elif space.isinstance_w(w_other, space.w_bytearray):
# XXX: eliminate double-copy
from .bytearrayobject import W_BytearrayObject, _make_data
diff --git a/pypy/objspace/std/test/test_bytesobject.py b/pypy/objspace/std/test/test_bytesobject.py
index d869578330..1ce5821418 100644
--- a/pypy/objspace/std/test/test_bytesobject.py
+++ b/pypy/objspace/std/test/test_bytesobject.py
@@ -846,3 +846,7 @@ class AppTestBytesObject:
return 42
x = Foo()
assert "hello" + x == 42
+
+ def test_add(self):
+ assert 'abc' + 'abc' == 'abcabc'
+ assert isinstance('abc' + u'\u03a3', unicode)