]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport trunk's revision 51565:
authorThomas Wouters <thomas@python.org>
Thu, 24 Aug 2006 18:55:01 +0000 (18:55 +0000)
committerThomas Wouters <thomas@python.org>
Thu, 24 Aug 2006 18:55:01 +0000 (18:55 +0000)
Fix SF bug #1545837: array.array borks on deepcopy.
array.__deepcopy__() needs to take an argument, even if it doesn't actually
use it. Will backport to 2.5 and 2.4 (if applicable.)

Lib/test/test_array.py
Misc/ACKS
Modules/arraymodule.c

index b15298fbfedc07b17540b53787d5e7ca70100185..3bf52f00261dfaaf171d3005ba6351c6c0846dc1 100755 (executable)
@@ -81,6 +81,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_insert(self):
         a = array.array(self.typecode, self.example)
         a.insert(0, self.example[0])
index 8806c801afd509bc5019ca67d8b6d452b1d2d557..00ee420a6d54bc835b8c67925be010697ad33ec0 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -227,6 +227,7 @@ Dag Gruneau
 Michael Guravage
 Lars Gustäbel
 Barry Haddow
+Václav Haisman
 Paul ten Hagen
 Rasmus Hahn
 Peter Haight
index f8c4918003e3e9818d473a74617fd3c5c4fde643..469c5cbcf20e86ff022d4e3fe8d05f9a68333de6 100644 (file)
@@ -1468,7 +1468,7 @@ PyMethodDef array_methods[] = {
         copy_doc},
        {"count",       (PyCFunction)array_count,       METH_O,
         count_doc},
-       {"__deepcopy__",(PyCFunction)array_copy,        METH_NOARGS,
+       {"__deepcopy__",(PyCFunction)array_copy,        METH_O,
         copy_doc},
        {"extend",      (PyCFunction)array_extend,      METH_O,
         extend_doc},