summaryrefslogtreecommitdiff
path: root/webtest/debugapp.py
diff options
context:
space:
mode:
authorGael Pasgrimaud <gael@gawel.org>2013-02-21 20:38:03 +0100
committerGael Pasgrimaud <gael@gawel.org>2013-02-21 20:38:03 +0100
commite35b0f12bc1cdaec3f1ac8ca67c2af52a46655aa (patch)
tree51b119349e7cc228b1e1bd908795d633a09499e0 /webtest/debugapp.py
parent72ba535d06e950b1f20002b1d83408496fa25012 (diff)
downloadwebtest-e35b0f12bc1cdaec3f1ac8ca67c2af52a46655aa.tar.gz
fix test for py3X
Diffstat (limited to 'webtest/debugapp.py')
-rw-r--r--webtest/debugapp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/webtest/debugapp.py b/webtest/debugapp.py
index 8b1231b..ca2af47 100644
--- a/webtest/debugapp.py
+++ b/webtest/debugapp.py
@@ -28,7 +28,10 @@ class DebugApp(object):
raise Exception('Exception requested')
if 'errorlog' in req.GET:
- req.environ['wsgi.errors'].write(req.GET['errorlog'])
+ log = req.GET['errorlog']
+ if not six.PY3 and not isinstance(log, six.binary_type):
+ log = log.encode('utf8')
+ req.environ['wsgi.errors'].write(log)
status = str(req.GET.get('status', '200 OK'))