fix for a bug reported by ToR (AttributeError: 'NoneType' object has no attribute 'redcode')

This commit is contained in:
Miroslav Stampar 2011-04-12 13:25:28 +00:00
parent 1c51e11c5c
commit a883ce26b5

View File

@ -55,6 +55,7 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
if "set-cookie" in headers: if "set-cookie" in headers:
result.setcookie = headers["set-cookie"].split("; path")[0] result.setcookie = headers["set-cookie"].split("; path")[0]
if result:
result.redcode = code result.redcode = code
return result return result