[py2.6] use hashlib to silence python 2.6 deprecation warnings stable
authorauc
Thu, 17 Jun 2010 15:02:24 +0200
branchstable
changeset 5770 9e4f8db66962
parent 5769 b3b48e0b8e3b
child 5771 c077df1d0333
[py2.6] use hashlib to silence python 2.6 deprecation warnings
md5crypt.py
web/request.py
--- a/md5crypt.py	Thu Jun 17 15:02:22 2010 +0200
+++ b/md5crypt.py	Thu Jun 17 15:02:24 2010 +0200
@@ -61,7 +61,7 @@
 MAGIC = '$1$'                        # Magic string
 ITOA64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
 
-import md5
+import hashlib as md5
 
 def to64 (v, n):
     ret = ''
--- a/web/request.py	Thu Jun 17 15:02:22 2010 +0200
+++ b/web/request.py	Thu Jun 17 15:02:24 2010 +0200
@@ -20,7 +20,7 @@
 __docformat__ = "restructuredtext en"
 
 import Cookie
-import sha
+import hashlib
 import time
 import random
 import base64
@@ -359,9 +359,9 @@
 
     def register_onetime_callback(self, func, *args):
         cbname = 'cb_%s' % (
-            sha.sha('%s%s%s%s' % (time.time(), func.__name__,
-                                  random.random(),
-                                  self.user.login)).hexdigest())
+            hashlib.sha('%s%s%s%s' % (time.time(), func.__name__,
+                                      random.random(),
+                                      self.user.login)).hexdigest())
         def _cb(req):
             try:
                 ret = func(req, *args)