From 02ca442cf068d33d75ace13a122b8ddc0a2afdd4 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Fri, 15 Feb 2013 13:07:13 +0530 Subject: [PATCH] Use hashlib module instead of the deprecated md5 module Deprecated since version 2.5 Python3 does not contain the deprecated md5 module --- directives.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/directives.py b/directives.py index bfd2b78..ac59d06 100644 --- a/directives.py +++ b/directives.py @@ -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