From b8957e0c6e5dfa746636934052cb2d5d022fe7cc Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Mon, 8 Jul 2013 12:46:36 -0400 Subject: [PATCH] Stop using deprecated md5, switch to hashlib. Closes #36 --- moto/s3/models.py | 4 ++-- moto/sqs/models.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/moto/s3/models.py b/moto/s3/models.py index 524d547e9..62de695fa 100644 --- a/moto/s3/models.py +++ b/moto/s3/models.py @@ -1,5 +1,5 @@ import datetime -import md5 +import hashlib from moto.core import BaseBackend from moto.core.utils import iso_8601_datetime, rfc_1123_datetime @@ -22,7 +22,7 @@ class FakeKey(object): @property def etag(self): - value_md5 = md5.new() + value_md5 = hashlib.md5() value_md5.update(self.value) return '"{0}"'.format(value_md5.hexdigest()) diff --git a/moto/sqs/models.py b/moto/sqs/models.py index 3f3b6b493..5c6d04fe7 100644 --- a/moto/sqs/models.py +++ b/moto/sqs/models.py @@ -1,4 +1,4 @@ -import md5 +import hashlib import time from moto.core import BaseBackend @@ -15,7 +15,7 @@ class Message(object): @property def md5(self): - body_md5 = md5.new() + body_md5 = hashlib.md5() body_md5.update(self.body) return body_md5.hexdigest()