Skip to content

Commit

Permalink
make sure all examples work on python 3
Browse files Browse the repository at this point in the history
fix #1961
  • Loading branch information
benoitc committed Jan 24, 2019
1 parent 97a4580 commit fe7632f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions examples/echo.py
Expand Up @@ -24,8 +24,7 @@ def app(environ, start_response):
response_headers = [
('Content-type', 'text/plain'),
('Content-Length', str(len(data))),
('X-Gunicorn-Version', __version__),
("Test", "test тест"),
('X-Gunicorn-Version', __version__)
]
start_response(status, response_headers)
return iter([data])
2 changes: 1 addition & 1 deletion examples/log_app.py
Expand Up @@ -13,4 +13,4 @@ def app(environ, start_response):
log.info("Hello Info!")
log.warn("Hello Warn!")
log.error("Hello Error!")
return ["Hello World!\n"]
return [b"Hello World!\n"]
7 changes: 3 additions & 4 deletions examples/readline.py → examples/readline_app.py
Expand Up @@ -9,7 +9,7 @@
#
# Launch a server with the app in a terminal
#
# $ gunicorn -w3 readline:app
# $ gunicorn -w3 readline_app:app
#
# Then in another terminal launch the following command:
#
Expand All @@ -27,8 +27,7 @@ def app(environ, start_response):
response_headers = [
('Content-type', 'text/plain'),
('Transfer-Encoding', "chunked"),
('X-Gunicorn-Version', __version__),
#("Test", "test тест"),
('X-Gunicorn-Version', __version__)
]
start_response(status, response_headers)

Expand All @@ -42,4 +41,4 @@ def app(environ, start_response):
print(line)
lines.append(line)

return iter(lines)
return iter(lines)
3 changes: 1 addition & 2 deletions examples/test.py
Expand Up @@ -20,8 +20,7 @@ def app(environ, start_response):
response_headers = [
('Content-type', 'text/plain'),
('Content-Length', str(len(data))),
('X-Gunicorn-Version', __version__),
#("Test", "test тест"),
('X-Gunicorn-Version', __version__)
]
start_response(status, response_headers)
return iter([data])

0 comments on commit fe7632f

Please sign in to comment.