From a883ce26b580554e3e003eed40024b5fe84f274f Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 12 Apr 2011 13:25:28 +0000 Subject: [PATCH] fix for a bug reported by ToR (AttributeError: 'NoneType' object has no attribute 'redcode') --- lib/request/redirecthandler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/request/redirecthandler.py b/lib/request/redirecthandler.py index e16d0b185..fa9248813 100644 --- a/lib/request/redirecthandler.py +++ b/lib/request/redirecthandler.py @@ -55,7 +55,8 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler): if "set-cookie" in headers: result.setcookie = headers["set-cookie"].split("; path")[0] - result.redcode = code + if result: + result.redcode = code return result