@@ -84,6 +84,12 @@ def __init__(self, detail=None, headers=None, comment=None,
84
84
_HTTPNotFound .__init__ (self , detail = detail , headers = headers ,
85
85
comment = comment , body_template = body_template ,
86
86
** kw )
87
+ if not ('body' in kw or 'app_iter' in kw ):
88
+ if not self .empty_body :
89
+ body = self .html_body (self .environ )
90
+ if isinstance (body , unicode ):
91
+ body = body .encode (self .charset )
92
+ self .body = body
87
93
88
94
class HTTPForbidden (_HTTPForbidden ):
89
95
"""
@@ -114,6 +120,12 @@ def __init__(self, detail=None, headers=None, comment=None,
114
120
_HTTPForbidden .__init__ (self , detail = detail , headers = headers ,
115
121
comment = comment , body_template = body_template ,
116
122
** kw )
123
+ if not ('body' in kw or 'app_iter' in kw ):
124
+ if not self .empty_body :
125
+ body = self .html_body (self .environ )
126
+ if isinstance (body , unicode ):
127
+ body = body .encode (self .charset )
128
+ self .body = body
117
129
118
130
NotFound = HTTPNotFound # bw compat
119
131
Forbidden = HTTPForbidden # bw compat
0 commit comments