diff MoinMoin/userprefs/oid.py @ 4363:817d99d715fe

remove direct usage of deprecated sha module - use hashlib, if possible
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 03 Oct 2008 22:33:35 +0200
parents 7bfd4232cfb7
children eda647742453 776cc7f6f6c6
line wrap: on
line diff
--- a/MoinMoin/userprefs/oid.py	Fri Oct 03 21:18:49 2008 +0200
+++ b/MoinMoin/userprefs/oid.py	Fri Oct 03 22:33:35 2008 +0200
@@ -9,7 +9,8 @@
 from MoinMoin import wikiutil, user
 from MoinMoin.widget import html
 from MoinMoin.userprefs import UserPrefBase
-import sha
+from MoinMoin.support.python_compatibility import hash_new
+
 try:
     from MoinMoin.auth.openidrp import OpenIDAuth
     from MoinMoin.util.moinoid import MoinOpenIDStore
@@ -45,7 +46,7 @@
             return
         openids = self.request.user.openids[:]
         for oid in self.request.user.openids:
-            name = "rm-%s" % sha.new(oid).hexdigest()
+            name = "rm-%s" % hash_new('sha1', oid).hexdigest()
             if name in self.request.form:
                 openids.remove(oid)
         if not openids and len(self.request.cfg.auth) == 1:
@@ -170,7 +171,7 @@
         _ = self.request.getText
         form = self._make_form()
         for oid in self.request.user.openids:
-            name = "rm-%s" % sha.new(oid).hexdigest()
+            name = "rm-%s" % hash_new('sha1', oid).hexdigest()
             form.append(html.INPUT(type="checkbox", name=name, id=name))
             form.append(html.LABEL(for_=name).append(html.Text(oid)))
             form.append(html.BR())