diff options
author | Guido van Rossum <guido@python.org> | 2001-12-28 21:39:03 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-12-28 21:39:03 (GMT) |
commit | 2764a3a50ebb467690d77f8925a3414d71756311 (patch) | |
tree | 602dd331e7d4af15e8ad77a34516404e0fc092b0 | |
parent | 1e91c1444a9c8b8b58310cffbe4252698527a31e (diff) | |
download | cpython-2764a3a50ebb467690d77f8925a3414d71756311.zip cpython-2764a3a50ebb467690d77f8925a3414d71756311.tar.gz cpython-2764a3a50ebb467690d77f8925a3414d71756311.tar.bz2 |
Fix for SF bug ##497426: can't deepcopy recursive new objects
deepcopy(), _reconstruct(): pass the memo to the other function, so
that recursive data structures built out of new-style objects may be
deeply copied correctly.
2.2.1 bugfix!
-rw-r--r-- | Lib/test/test_descr.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index ea987f2..dd95dde 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -2702,7 +2702,15 @@ def strops(): vereq('%c' % 5, '\x05') vereq('%c' % '5', '5') - +def deepcopyrecursive(): + if verbose: print "Testing deepcopy of recursive objects..." + class Node: + pass + a = Node() + b = Node() + a.b = b + b.a = a + z = deepcopy(a) # This blew up before def test_main(): @@ -2759,6 +2767,7 @@ def test_main(): delhook() hashinherit() strops() + deepcopyrecursive() if verbose: print "All OK" if __name__ == "__main__": |