1. Kamil Kisiel
  2. TracMathPlugin

Commits

Kamil Kisiel  committed 336545d

Fixed sha module deprecation

  • Participants
  • Parent commits 278a4dd
  • Branches default

Comments (0)

Files changed (1)

File tracmath/tracmath.py

View file
  • Ignore whitespace
 
 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)