web/request.py
changeset 5890 141b935a38fc
parent 5811 e77cea9721e7
parent 5884 a0eb685dfe7a
child 5940 0e3ae19b181a
--- a/web/request.py	Mon Jul 05 15:59:14 2010 +0200
+++ b/web/request.py	Mon Jul 05 18:00:33 2010 +0200
@@ -20,12 +20,7 @@
 __docformat__ = "restructuredtext en"
 
 import Cookie
-try:
-    import hashlib
-    hashlib.hash
-except AttributeError:
-    # python 2.5 ...
-    import sha as hashlib
+import hashlib
 import time
 import random
 import base64
@@ -369,9 +364,9 @@
 
     def register_onetime_callback(self, func, *args):
         cbname = 'cb_%s' % (
-            hashlib.sha('%s%s%s%s' % (time.time(), func.__name__,
-                                      random.random(),
-                                      self.user.login)).hexdigest())
+            hashlib.sha1('%s%s%s%s' % (time.time(), func.__name__,
+                                       random.random(),
+                                       self.user.login)).hexdigest())
         def _cb(req):
             try:
                 ret = func(req, *args)