diff MoinMoin/security/textcha.py @ 6103:500f68d3e2fd

remove our own usage of python_compatibility module
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 06 Sep 2016 01:00:25 +0200
parents e1e9c0f9d7dd
children 561b7a9c2bd9
line wrap: on
line diff
--- a/MoinMoin/security/textcha.py	Tue Sep 06 00:26:46 2016 +0200
+++ b/MoinMoin/security/textcha.py	Tue Sep 06 01:00:25 2016 +0200
@@ -19,7 +19,7 @@
     @copyright: 2007 by MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
-
+import hmac
 import re
 import random
 
@@ -30,7 +30,6 @@
 
 from MoinMoin import wikiutil
 from werkzeug.security import safe_str_cmp as safe_str_equal
-from MoinMoin.support.python_compatibility import hmac_new
 
 SHA1_LEN = 40 # length of hexdigest
 TIMESTAMP_LEN = 10 # length of timestamp
@@ -85,7 +84,7 @@
 
     def _compute_signature(self, question, timestamp):
         signature = u"%s%d" % (question, timestamp)
-        return hmac_new(self.secret, signature.encode('utf-8')).hexdigest()
+        return hmac.new(self.secret, signature.encode('utf-8')).hexdigest()
 
     def _init_qa(self, question=None):
         """ Initialize the question / answer.