summaryrefslogtreecommitdiff
path: root/sphinx/ext/pngmath.py
diff options
context:
space:
mode:
authorTakayuki Shimizukawa <shimizukawa@gmail.com>2014-08-10 17:01:21 +0900
committerTakayuki Shimizukawa <shimizukawa@gmail.com>2014-08-10 17:01:21 +0900
commite19f97dae1745a4376d059b3d07e605144ce0719 (patch)
tree6f8bf0cd0173bce6e8241acd99986b4d966168b4 /sphinx/ext/pngmath.py
parent7aed098f5d231d6a5018169664f39397a3eba54f (diff)
downloadsphinx-git-e19f97dae1745a4376d059b3d07e605144ce0719.tar.gz
refactoring. remove old python related code (from sha import sha)
Diffstat (limited to 'sphinx/ext/pngmath.py')
-rw-r--r--sphinx/ext/pngmath.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py
index e0fed6e0d..7b1af9705 100644
--- a/sphinx/ext/pngmath.py
+++ b/sphinx/ext/pngmath.py
@@ -16,10 +16,7 @@ import tempfile
import posixpath
from os import path, getcwd, chdir
from subprocess import Popen, PIPE
-try:
- from hashlib import sha1 as sha
-except ImportError:
- from sha import sha
+from hashlib import sha1
from six import text_type
from docutils import nodes
@@ -86,7 +83,7 @@ def render_math(self, math):
latex = DOC_HEAD + self.builder.config.pngmath_latex_preamble
latex += (use_preview and DOC_BODY_PREVIEW or DOC_BODY) % math
- shasum = "%s.png" % sha(latex.encode('utf-8')).hexdigest()
+ shasum = "%s.png" % sha1(latex.encode('utf-8')).hexdigest()
relfn = posixpath.join(self.builder.imgpath, 'math', shasum)
outfn = path.join(self.builder.outdir, '_images', 'math', shasum)
if path.isfile(outfn):