From 309e6be0e83b5ed08f954c7dd66c5e8cf959a006 Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Mon, 6 Feb 2017 21:32:03 -0700 Subject: stringify self.detail in case it is not a string --- pyramid/httpexceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py index a22b088c6..1f3934fdc 100644 --- a/pyramid/httpexceptions.py +++ b/pyramid/httpexceptions.py @@ -238,7 +238,7 @@ ${body}''') del self.content_length def __str__(self): - return self.detail or self.explanation + return str(self.detail) if self.detail else self.explanation def _json_formatter(self, status, body, title, environ): return {'message': body, -- cgit v1.2.3