Commits

Kamil Kisiel committed 336545d

Fixed sha module deprecation

Comments (0)

Files changed (1)

tracmath/tracmath.py

 
 import codecs
 import re
-import sha
 from cStringIO import StringIO
 import os
 import sys
             """
 
     def internal_render(self, req, name, content):
+        from hashlib import sha1
         if not name == 'latex':
             return 'Unknown macro %s' % (name)
 
             if m:
                 label = m.group(1)
 
-        key = sha.new(content.encode('utf-8')).hexdigest()
+        key = sha1(content.encode('utf-8')).hexdigest()
 
         imgname = key + '.png'
         imgpath = os.path.join(self.cacheDirectory, imgname)