Skip to content

Commit 5a43f72

Browse files
committed
make sure all examples work on python 3
fix #1690
1 parent 97a4580 commit 5a43f72

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

examples/echo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def app(environ, start_response):
2424
response_headers = [
2525
('Content-type', 'text/plain'),
2626
('Content-Length', str(len(data))),
27-
('X-Gunicorn-Version', __version__),
28-
("Test", "test тест"),
27+
('X-Gunicorn-Version', __version__)
2928
]
3029
start_response(status, response_headers)
3130
return iter([data])

examples/log_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ def app(environ, start_response):
1313
log.info("Hello Info!")
1414
log.warn("Hello Warn!")
1515
log.error("Hello Error!")
16-
return ["Hello World!\n"]
16+
return [b"Hello World!\n"]

examples/readline.py renamed to examples/readline_app.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
# Launch a server with the app in a terminal
1111
#
12-
# $ gunicorn -w3 readline:app
12+
# $ gunicorn -w3 readline_app:app
1313
#
1414
# Then in another terminal launch the following command:
1515
#
@@ -27,8 +27,7 @@ def app(environ, start_response):
2727
response_headers = [
2828
('Content-type', 'text/plain'),
2929
('Transfer-Encoding', "chunked"),
30-
('X-Gunicorn-Version', __version__),
31-
#("Test", "test тест"),
30+
('X-Gunicorn-Version', __version__)
3231
]
3332
start_response(status, response_headers)
3433

@@ -42,4 +41,4 @@ def app(environ, start_response):
4241
print(line)
4342
lines.append(line)
4443

45-
return iter(lines)
44+
return iter(lines)

examples/test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ def app(environ, start_response):
2020
response_headers = [
2121
('Content-type', 'text/plain'),
2222
('Content-Length', str(len(data))),
23-
('X-Gunicorn-Version', __version__),
24-
#("Test", "test тест"),
23+
('X-Gunicorn-Version', __version__)
2524
]
2625
start_response(status, response_headers)
2726
return iter([data])

0 commit comments

Comments
 (0)