modify for python3

(cherry picked from commit 04b37d3313fbc31f22cf26534257b43e2840bdc4)
This commit is contained in:
wuyingren
2019-05-03 13:38:37 -06:00
committed by Roman Dobosz
parent c6a78ef0b5
commit 5b8eef7d05
+2 -2
View File
@@ -51,8 +51,8 @@ class Pygments(Directive):
# Construct cache filename # Construct cache filename
cache_file = None cache_file = None
content_text = u'\n'.join(self.content) content_text = u'\n'.join(self.content).encode('utf-8')
cache_file_name = '%s-%s.html' % (lexer_name, hashlib.md5(content_text).hexdigest()) cache_file_name = u'%s-%s.html' % (lexer_name, hashlib.md5(content_text).hexdigest())
cached_path = os.path.join(PYGMENTS_CACHE_DIR, cache_file_name) cached_path = os.path.join(PYGMENTS_CACHE_DIR, cache_file_name)
# Look for cached version, otherwise parse # Look for cached version, otherwise parse