From 2f55393593fb0d8818fa014bc004dfed73564110 Mon Sep 17 00:00:00 2001 From: Den Shabalin Date: Fri, 19 Aug 2011 19:18:26 +0300 Subject: [PATCH] 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. --- requests/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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.""" -- 2.34.1