summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_bytes.py2
-rw-r--r--Objects/unicodeobject.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 1d826b6..999346f 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -374,7 +374,7 @@ class BytesTest(unittest.TestCase):
self.assertEqual(b1 + "def", bytes("abcdef"))
self.assertEqual("def" + b1, bytes("defabc"))
self.assertRaises(TypeError, lambda: b1 + u"def")
- ##self.assertRaises(TypeError, lambda: u"abc" + b2) # XXX FIXME
+ self.assertRaises(TypeError, lambda: u"abc" + b2)
def test_repeat(self):
b = bytes("abc")
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 4fe4d10..ce28692 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -5535,6 +5535,9 @@ PyObject *PyUnicode_Concat(PyObject *left,
{
PyUnicodeObject *u = NULL, *v = NULL, *w;
+ if (PyBytes_Check(left) || PyBytes_Check(right))
+ return PyBytes_Concat(left, right);
+
/* Coerce the two arguments */
u = (PyUnicodeObject *)PyUnicode_FromObject(left);
if (u == NULL)