From: Telofy Date: Mon, 30 Jan 2012 11:23:43 +0000 (+0100) Subject: The `self` was missing again, and I think the two blocks were redundant. X-Git-Tag: v0.10.2~32^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a61a861cfb8ae9a0bb14e4fce7859a5ed865840c;p=services%2Fpython-requests.git The `self` was missing again, and I think the two blocks were redundant. --- diff --git a/requests/models.py b/requests/models.py index 7ac85cc..7126f08 100644 --- a/requests/models.py +++ b/requests/models.py @@ -773,17 +773,10 @@ class Response(object): # Decode unicode from given encoding. try: - content = str(self.content, encoding) + content = str(self.content, encoding, errors='replace') except (UnicodeError, TypeError): pass - # Try to fall back: - if not content: - try: - content = str(content, encoding, errors='replace') - except (UnicodeError, TypeError): - pass - return content