Update Python 3 compatibility
This commit is contained in:
+6
-7
@@ -9,10 +9,9 @@
|
||||
The gluon wsgi application
|
||||
---------------------------
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
if False:
|
||||
import import_all # DO NOT REMOVE PART OF FREEZE PROCESS
|
||||
from . import import_all # DO NOT REMOVE PART OF FREEZE PROCESS
|
||||
import gc
|
||||
|
||||
import os
|
||||
@@ -249,7 +248,7 @@ class LazyWSGI(object):
|
||||
def app(environ, start_response):
|
||||
data = f()
|
||||
start_response(self.response.status,
|
||||
self.response.headers.items())
|
||||
list(self.response.headers.items()))
|
||||
if isinstance(data, list):
|
||||
return data
|
||||
return [data]
|
||||
@@ -486,10 +485,10 @@ def wsgibase(environ, responder):
|
||||
if request.ajax:
|
||||
if response.flash:
|
||||
http_response.headers['web2py-component-flash'] = \
|
||||
urllib2.quote(xmlescape(response.flash).replace(b'\n', b''))
|
||||
urllib_quote(xmlescape(response.flash).replace(b'\n', b''))
|
||||
if response.js:
|
||||
http_response.headers['web2py-component-command'] = \
|
||||
urllib2.quote(response.js.replace('\n', ''))
|
||||
urllib_quote(response.js.replace('\n', ''))
|
||||
|
||||
# ##################################################
|
||||
# store cookies in headers
|
||||
@@ -717,9 +716,9 @@ class HttpServer(object):
|
||||
if isinstance(interfaces, list):
|
||||
for i in interfaces:
|
||||
if not isinstance(i, tuple):
|
||||
raise "Wrong format for rocket interfaces parameter - see http://packages.python.org/rocket/"
|
||||
raise AttributeError("Wrong format for rocket interfaces parameter - see http://packages.python.org/rocket/")
|
||||
else:
|
||||
raise "Wrong format for rocket interfaces parameter - see http://packages.python.org/rocket/"
|
||||
raise AttributeError("Wrong format for rocket interfaces parameter - see http://packages.python.org/rocket/")
|
||||
|
||||
if path:
|
||||
# if a path is specified change the global variables so that web2py
|
||||
|
||||
Reference in New Issue
Block a user