Skip to content

Commit

Permalink
Merge pull request boto#2468 from felixonmars/hashlib-imports
Browse files Browse the repository at this point in the history
Remove obsolete md5 import routine. Fixes boto#2468.
  • Loading branch information
danielgtaylor committed Aug 1, 2014
2 parents 984c5ff + 7f88166 commit 9808a77
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 26 deletions.
5 changes: 1 addition & 4 deletions boto/gs/resumable_upload_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@
import socket
import time
import urlparse
from hashlib import md5
from boto import config, UserAgent
from boto.connection import AWSAuthConnection
from boto.exception import InvalidUriError
from boto.exception import ResumableTransferDisposition
from boto.exception import ResumableUploadException
from boto.s3.keyfile import KeyFile
try:
from hashlib import md5
except ImportError:
from md5 import md5

"""
Handler for Google Cloud Storage resumable uploads. See
Expand Down
6 changes: 1 addition & 5 deletions boto/s3/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import base64
import binascii
import math
from hashlib import md5
import boto.utils
from boto.compat import BytesIO, six, urllib, encodebytes

Expand All @@ -45,11 +46,6 @@
from boto.utils import find_matching_headers
from boto.utils import merge_headers_by_name

try:
from hashlib import md5
except ImportError:
from md5 import md5


class Key(object):
"""
Expand Down
14 changes: 2 additions & 12 deletions boto/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,8 @@

from contextlib import contextmanager

try:
from hashlib import md5
except ImportError:
from md5 import md5


try:
import hashlib
_hashfn = hashlib.sha512
except ImportError:
import md5
_hashfn = md5.md5
from hashlib import md5, sha512
_hashfn = sha512

from boto.compat import json

Expand Down
6 changes: 1 addition & 5 deletions tests/integration/s3/mock_storage_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,14 @@
import boto
import base64
import re
from hashlib import md5

from boto.utils import compute_md5
from boto.utils import find_matching_headers
from boto.utils import merge_headers_by_name
from boto.s3.prefix import Prefix
from boto.compat import six

try:
from hashlib import md5
except ImportError:
from md5 import md5

NOT_IMPL = None


Expand Down

0 comments on commit 9808a77

Please sign in to comment.