diff MoinMoin/config/multiconfig.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 4f3d0b92d1c9
children eda647742453 fc4e32fdd922
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Fri Oct 03 21:18:49 2008 +0200
+++ b/MoinMoin/config/multiconfig.py	Fri Oct 03 22:33:35 2008 +0200
@@ -569,7 +569,8 @@
         Since each configured plugin path has unique plugins, we load the
         plugin packages as "moin_plugin_<sha1(path)>.plugin".
         """
-        import imp, sha
+        import imp
+        from MoinMoin.support.python_compatibility import hash_new
 
         plugin_dirs = [self.plugin_dir] + self.plugin_dirs
         self._plugin_modules = []
@@ -579,7 +580,7 @@
             imp.acquire_lock()
             try:
                 for pdir in plugin_dirs:
-                    csum = 'p_%s' % sha.new(pdir).hexdigest()
+                    csum = 'p_%s' % hash_new('sha1', pdir).hexdigest()
                     modname = '%s.%s' % (self.siteid, csum)
                     # If the module is not loaded, try to load it
                     if not modname in sys.modules: