Store the status exactly once on the HTTPRedirect. Status can no longer be set after the initial construction.
@@ -241,9 +241,13 @@ class HTTPRedirect(CherryPyException):
if status < 300 or status > 399:
raise ValueError('status must be between 300 and 399.')
- self.status = status
CherryPyException.__init__(self, abs_urls, status)
+ @property
+ def status(self):
+ urls, status = self.args[:2]
+ return status
+
def set_response(self):
"""Modify cherrypy.response status, headers, and body to represent
self.
