[web request] in python 2.5 hashlib has no .hash attribute stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 17 Jun 2010 16:17:09 +0200
branchstable
changeset 5777 941038164cf5
parent 5776 e7a88c97fef7
child 5778 1a4ac9e2ce63
[web request] in python 2.5 hashlib has no .hash attribute
web/request.py
--- a/web/request.py	Thu Jun 17 16:16:08 2010 +0200
+++ b/web/request.py	Thu Jun 17 16:17:09 2010 +0200
@@ -20,7 +20,12 @@
 __docformat__ = "restructuredtext en"
 
 import Cookie
-import hashlib
+try:
+    import hashlib
+    hashlib.hash
+except AttributeError:
+    # python 2.5 ...
+    import sha as hashlib
 import time
 import random
 import base64