From: Antony Chazapis Date: Wed, 2 May 2012 13:51:19 +0000 (+0300) Subject: Fix out-of-range issue with iter_lines (#515). X-Git-Tag: v0.12.1~5^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c333bd144e72d82a44dba03b6020e9e77e985e6a;p=services%2Fpython-requests.git Fix out-of-range issue with iter_lines (#515). --- diff --git a/requests/models.py b/requests/models.py index ff0ef01..0143b87 100644 --- a/requests/models.py +++ b/requests/models.py @@ -751,7 +751,7 @@ class Response(object): chunk = pending + chunk lines = chunk.splitlines() - if lines[-1][-1] == chunk[-1]: + if lines and lines[-1] and chunk and lines[-1][-1] == chunk[-1]: pending = lines.pop() else: pending = None