diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-04-22 02:33:32 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-04-22 02:33:32 +0200 |
| commit | 3026086c19b45382d5ceca778a5458233b485ce9 (patch) | |
| tree | a58fb49cd65f9b7ff24029aeb4dfaccd657128dd /paste/httpexceptions.py | |
| parent | 3e25cb1adbf0dce96f49a270d07028550b15e33c (diff) | |
| parent | b9ceb0a57e2c48f95e94693da5f3f4b86fbc3bff (diff) | |
| download | paste-3026086c19b45382d5ceca778a5458233b485ce9.tar.gz | |
Merged in mfrobben/paste (pull request #21)
Fix bad reference to iterator variable
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): |
