Skip to content

Commit

Permalink
Use real 'httplib2.Response'.
Browse files Browse the repository at this point in the history
Addresses:
#1717 (comment)
  • Loading branch information
tseaver committed Apr 18, 2016
1 parent f46864b commit d8729b7
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions gcloud/storage/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import os
import time

import httplib2
import six
from six.moves.urllib.parse import quote

Expand Down Expand Up @@ -353,7 +354,7 @@ def _check_response_error(request, http_response):
info = http_response.info
status = int(info['status'])
if not 200 <= status < 300:
faux_response = _FauxResponse(status)
faux_response = httplib2.Response({'status': status})
raise make_exception(faux_response, http_response.content,
error_info=request.url)

Expand Down Expand Up @@ -837,9 +838,3 @@ def __init__(self, bucket_name, object_name):
self.query_params = {'name': object_name}
self._bucket_name = bucket_name
self._relative_path = ''


class _FauxResponse(object):
"""Emulate httplib2's response object, given its 'info' dict."""
def __init__(self, status):
self.status = status

0 comments on commit d8729b7

Please sign in to comment.