From eb2c964aeb0ab0e3e01560c955cab95f8e3b92c2 Mon Sep 17 00:00:00 2001
From: Georg Brandl <georg@python.org>
Date: Fri, 30 May 2008 12:05:02 +0000
Subject: [PATCH] Add test case for r63810.

---
 Lib/test/test_bytes.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 206dde935b..4b346d6fee 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -832,6 +832,11 @@ class AssortedBytesTest(unittest.TestCase):
     def test_rsplit_bytearray(self):
         self.assertEqual(b'a b'.rsplit(memoryview(b' ')), [b'a', b'b'])
 
+    def test_return_self(self):
+        # bytearray.replace must always return a new bytearray
+        b = bytearray()
+        self.failIf(b.replace(b'', b'') is b)
+
     # Optimizations:
     # __iter__? (optimization)
     # __reversed__? (optimization)
-- 
2.49.0