mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Backport trunk checkin r51565:
Fix SF bug #1545837: array.array borks on deepcopy. array.__deepcopy__() needs to take an argument, even if it doesn't actually use it.
This commit is contained in:
parent
e38ecee5c3
commit
04e820443b
3 changed files with 9 additions and 1 deletions
|
@ -85,6 +85,13 @@ class BaseTest(unittest.TestCase):
|
|||
self.assertNotEqual(id(a), id(b))
|
||||
self.assertEqual(a, b)
|
||||
|
||||
def test_deepcopy(self):
|
||||
import copy
|
||||
a = array.array(self.typecode, self.example)
|
||||
b = copy.deepcopy(a)
|
||||
self.assertNotEqual(id(a), id(b))
|
||||
self.assertEqual(a, b)
|
||||
|
||||
def test_pickle(self):
|
||||
for protocol in (0, 1, 2):
|
||||
a = array.array(self.typecode, self.example)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue