1
0
mirror of https://github.com/gryf/jekyll-rst.git synced 2025-12-19 12:28:20 +01:00

Use hashlib module instead of the deprecated md5 module

Deprecated since version 2.5

Python3 does not contain the deprecated md5 module
This commit is contained in:
Vishesh Handa
2013-02-15 13:07:13 +05:30
parent 469e00b377
commit 02ca442cf0

View File

@@ -10,7 +10,7 @@
import re
import os
import md5
import hashlib
import __main__
# Absolute path to pygments cache dir
@@ -52,7 +52,7 @@ class Pygments(Directive):
# Construct cache filename
cache_file = None
content_text = u'\n'.join(self.content)
cache_file_name = '%s-%s.html' % (lexer_name, md5.new(content_text).hexdigest())
cache_file_name = '%s-%s.html' % (lexer_name, hashlib.md5(content_text).hexdigest())
cached_path = os.path.join(PYGMENTS_CACHE_DIR, cache_file_name)
# Look for cached version, otherwise parse