changeset 4364:5237eb242765

hmac_new: add missing import
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 04 Oct 2008 16:46:50 +0200
parents 817d99d715fe
children b88903618c75
files MoinMoin/support/python_compatibility.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/support/python_compatibility.py	Fri Oct 03 22:33:35 2008 +0200
+++ b/MoinMoin/support/python_compatibility.py	Sat Oct 04 16:46:50 2008 +0200
@@ -86,7 +86,7 @@
     def hmac_new(key, msg, digestmod=hashlib.sha1):
         return hmac.new(key, msg, digestmod)
 
-except (NameError,  ImportError):
+except (NameError, ImportError):
     import sha
     def hash_new(name, string=''):
         if name in ('SHA1', 'sha1'):
@@ -97,5 +97,6 @@
         raise ValueError("unsupported hash type")
 
     def hmac_new(key, msg, digestmod=sha):
+        import hmac
         return hmac.new(key, msg, digestmod)