diff --git a/examples/alt_spec.py b/examples/alt_spec.py index 074781a3..d5c682f1 100644 --- a/examples/alt_spec.py +++ b/examples/alt_spec.py @@ -13,7 +13,7 @@ def load(arg): def app(environ, start_response): - data = 'Hello, %s!\n' % arg + data = b'Hello, %s!\n' % arg status = '200 OK' response_headers = [ ('Content-type', 'text/plain'), diff --git a/examples/echo.py b/examples/echo.py index 974079a9..5f7d79e2 100644 --- a/examples/echo.py +++ b/examples/echo.py @@ -5,20 +5,15 @@ # # Example code from Eventlet sources -import os -import pprint from wsgiref.validate import validator -import sys from gunicorn import __version__ -#@validator + + +@validator def app(environ, start_response): """Simplest possible application object""" - errors = environ['wsgi.errors'] -# pprint.pprint(('ENVIRON', environ), stream=errors) - - print(environ) if environ['REQUEST_METHOD'].upper() != 'POST': data = b'Hello, World!\n' else: diff --git a/examples/multiapp.py b/examples/multiapp.py index c6a4c90b..c8888586 100644 --- a/examples/multiapp.py +++ b/examples/multiapp.py @@ -16,7 +16,7 @@ try: from routes import Mapper -except: +except ImportError: print("This example requires Routes to be installed") # Obviously you'd import your app callables diff --git a/examples/sendfile.py b/examples/sendfile.py index 346d0381..d8489d9b 100644 --- a/examples/sendfile.py +++ b/examples/sendfile.py @@ -8,7 +8,8 @@ import os from wsgiref.validate import validator -#@validator + +@validator def app(environ, start_response): """Simplest possible application object""" status = '200 OK' diff --git a/examples/test.py b/examples/test.py index fc8b8162..84f9102c 100644 --- a/examples/test.py +++ b/examples/test.py @@ -5,19 +5,15 @@ # # Example code from Eventlet sources -import os -import pprint from wsgiref.validate import validator -import sys from gunicorn import __version__ -#@validator + + +@validator def app(environ, start_response): """Simplest possible application object""" - errors = environ['wsgi.errors'] -# pprint.pprint(('ENVIRON', environ), stream=errors) - data = b'Hello, World!\n' status = '200 OK'