cubicweb/web/application.py
changeset 12567 26744ad37953
parent 12542 85194bd49119
child 12681 42afaaf708d8
--- a/cubicweb/web/application.py	Fri Apr 05 17:21:14 2019 +0200
+++ b/cubicweb/web/application.py	Fri Apr 05 17:58:19 2019 +0200
@@ -19,14 +19,12 @@
 
 
 import contextlib
+import http.client as http_client
 import json
 import sys
 from time import clock, time
 from contextlib import contextmanager
 
-from six import text_type, binary_type
-from six.moves import http_client
-
 from rql import BadRQLQuery
 
 from cubicweb import set_log_methods
@@ -316,7 +314,7 @@
             # XXX ensure we don't actually serve content
             if not content:
                 content = self.need_login_content(req)
-        assert isinstance(content, binary_type)
+        assert isinstance(content, bytes)
         return content
 
     def core_handle(self, req):
@@ -481,7 +479,7 @@
         if req.status_out < 400:
             # don't overwrite it if it's already set
             req.status_out = status
-        json_dumper = getattr(ex, 'dumps', lambda: json.dumps({'reason': text_type(ex)}))
+        json_dumper = getattr(ex, 'dumps', lambda: json.dumps({'reason': str(ex)}))
         return json_dumper().encode('utf-8')
 
     # special case handling