Repository: libcloud Updated Branches: refs/heads/trunk 22cb3add4 -> 1ed588869
Explicitly check if response is None. In versions of requests < 3.0, the __bool__/__nonzero__ method on RawResponse is overloaded to return False if the status code is 4xx or 5xx. Closes #1006 Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/cbeebb1a Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/cbeebb1a Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/cbeebb1a Branch: refs/heads/trunk Commit: cbeebb1a1c08749f0ccc90b3d87a2b1cdc4288f9 Parents: 22cb3ad Author: Richard Xia <[email protected]> Authored: Wed Mar 8 22:41:04 2017 -0800 Committer: Anthony Shaw <[email protected]> Committed: Sat Apr 1 13:42:09 2017 +1100 ---------------------------------------------------------------------- libcloud/common/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/cbeebb1a/libcloud/common/base.py ---------------------------------------------------------------------- diff --git a/libcloud/common/base.py b/libcloud/common/base.py index c5759f3..de0c68a 100644 --- a/libcloud/common/base.py +++ b/libcloud/common/base.py @@ -282,7 +282,7 @@ class RawResponse(Response): self._error = None self._reason = None self.connection = connection - if response: + if response is not None: self.headers = lowercase_keys(dict(response.headers)) self.error = response.reason self.status = response.status_code
