From: Den Shabalin Date: Fri, 19 Aug 2011 16:18:26 +0000 (+0300) Subject: Fixes an issue #128: ``Response not working with lxml''. This error happend due to... X-Git-Tag: v0.6.1~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f55393593fb0d8818fa014bc004dfed73564110;p=services%2Fpython-requests.git Fixes an issue #128: ``Response not working with lxml''. This error happend due to lxml's attempt to do .geturl() call on the response object. __getattr__ didn't raise AttributeError so ``response.geturl'' returned None and ``response.geturl()'' resulted into ``TypeError: 'NoneType' object is not callable'' seen in the issue. --- diff --git a/requests/models.py b/requests/models.py index 0b22f71..5e0a4d3 100644 --- a/requests/models.py +++ b/requests/models.py @@ -416,7 +416,8 @@ class Response(object): except zlib.error: pass return self._content - + else: + raise AttributeError def raise_for_status(self): """Raises stored :class:`HTTPError` or :class:`URLError`, if one occured."""