summaryrefslogtreecommitdiff
path: root/www/trac-math/files/patch-tracmath_tracmath.py
blob: 89e5ea59b63aadde0936041f5b33b5e9a465e506 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- tracmath/tracmath.py.orig
+++ tracmath/tracmath.py
@@ -4,8 +4,8 @@
 """
 
 import codecs
+import hashlib
 import re
-import sha
 from cStringIO import StringIO
 import os
 import sys
@@ -142,7 +142,7 @@
             if m:
                 label = m.group(1)
 
-        key = sha.new(content.encode('utf-8')).hexdigest()
+        key = hashlib.sha1(content.encode('utf-8')).hexdigest()
 
         imgname = key + '.png'
         imgpath = os.path.join(self.cacheDirectory, imgname)