# Copyright (C) 2005 Gregory P. Smith (greg@electricrain.com)
# Licensed to PSF under a Contributor Agreement.
+import warnings
+warnings.warn("the md5 module is deprecated; use hashlib instead",
+ DeprecationWarning, 2)
+
from hashlib import md5
new = md5
# Testing md5 module
+import warnings
+warnings.filterwarnings("ignore", "the md5 module is deprecated.*",
+ DeprecationWarning)
import unittest
from md5 import md5
# hashing algorithms.
#
+import warnings
+warnings.filterwarnings("ignore", "the md5 module is deprecated.*",
+ DeprecationWarning)
+
import md5, sha, hmac
def check_hash_module(module, key=None):
import shutil
import tempfile
import StringIO
-import md5
+from hashlib import md5
import errno
import unittest
bz2 = None
def md5sum(data):
- return md5.new(data).hexdigest()
+ return md5(data).hexdigest()
def path(path):
return test_support.findfile(path)
def uuid3(namespace, name):
"""Generate a UUID from the MD5 hash of a namespace UUID and a name."""
- import md5
- hash = md5.md5(namespace.bytes + name).digest()
+ from hashlib import md5
+ hash = md5(namespace.bytes + name).digest()
return UUID(bytes=hash[:16], version=3)
def uuid4():
Library
-------
+- md5 now raises a DeprecationWarning upon import.
+
- mimify now raises a DeprecationWarning upon import.
- MimeWriter now raises a DeprecationWarning upon import.