Author: Justin Peel <notmuchtot...@gmail.com>
Branch: rgc-mem-pressure
Changeset: r48286:1376c2803ce7
Date: 2011-10-20 17:13 -0600
http://bitbucket.org/pypy/pypy/changeset/1376c2803ce7/

Log:    small fixes. memory leak is now completely stopped.

diff --git a/pypy/module/_hashlib/interp_hashlib.py 
b/pypy/module/_hashlib/interp_hashlib.py
--- a/pypy/module/_hashlib/interp_hashlib.py
+++ b/pypy/module/_hashlib/interp_hashlib.py
@@ -34,10 +34,10 @@
         rgc.add_memory_pressure(HASH_MALLOC_SIZE + self._digest_size())
         self.ctx = ctx
 
-    def initdigest(self):
-        digest = ropenssl.EVP_get_digestbyname(self.name)
+    def initdigest(self, space, name):
+        digest = ropenssl.EVP_get_digestbyname(name)
         if not digest:
-            raise OperationError(space.w_Value,
+            raise OperationError(space.w_ValueError,
                                  space.wrap("unknown hash function"))
         ropenssl.EVP_DigestInit(self.ctx, digest)
 
@@ -141,7 +141,7 @@
 @unwrap_spec(name=str, string='bufferstr')
 def new(space, name, string=''):
     w_hash = W_Hash(space, name)
-    w_hash.initdigest()
+    w_hash.initdigest(space, name)
     w_hash.update(space, string)
     return space.wrap(w_hash)
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to