diff options
Diffstat (limited to 'paste/httpexceptions.py')
-rw-r--r-- | paste/httpexceptions.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/paste/httpexceptions.py b/paste/httpexceptions.py index 492f558..6b8d5c5 100644 --- a/paste/httpexceptions.py +++ b/paste/httpexceptions.py @@ -205,9 +205,10 @@ class HTTPException(Exception): if self.headers: for (k, v) in self.headers: args[k.lower()] = escfunc(v) - for key, value in args.items(): - if isinstance(value, six.text_type): - args[key] = value.encode('utf8', 'xmlcharrefreplace') + if six.PY2: + for key, value in args.items(): + if isinstance(value, six.text_type): + args[key] = value.encode('utf8', 'xmlcharrefreplace') return template % args def plain(self, environ): |