[pypy-svn] r7662 - pypy/trunk/src/pypy/appspace

tismer at codespeak.net tismer at codespeak.net
Wed Nov 24 17:57:39 CET 2004


Author: tismer
Date: Wed Nov 24 17:57:39 2004
New Revision: 7662

Modified:
   pypy/trunk/src/pypy/appspace/md5.py
Log:
wrote MD5.copy without copy.deepcopy, to make genrpy happy.

Modified: pypy/trunk/src/pypy/appspace/md5.py
==============================================================================
--- pypy/trunk/src/pypy/appspace/md5.py	(original)
+++ pypy/trunk/src/pypy/appspace/md5.py	Wed Nov 24 17:57:39 2004
@@ -169,6 +169,7 @@
         "Initialize the message-digest and set all fields to zero."
 
         self.length = 0L
+        self.count = [0, 0]
         self.input = []
 
         # Load magic initialization constants.
@@ -389,8 +390,17 @@
         to efficiently compute the digests of strings that share
         a common initial substring.
         """
-
-        return copy.deepcopy(self)
+        if 0: # set this to 1 to make the flow space crash
+            return copy.deepcopy(self)
+        clone = self.__class__()
+        clone.length = self.length
+        clone.count  = [] + self.count[:]
+        clone.input  = [] + self.input
+        clone.A = self.A
+        clone.B = self.B
+        clone.C = self.C
+        clone.D = self.D
+        return clone
 
 
 # ======================================================================



More information about the Pypy-commit mailing list