Skip to content

Commit

Permalink
run_app: make print=None disable printing
Browse files Browse the repository at this point in the history
  • Loading branch information
seirl committed Sep 11, 2017
1 parent c7e8356 commit 7b20128
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Andrew Leech
Andrew Lytvyn
Andrew Svetlov
Andrii Soldatenko
Antoine Pietri
Anton Kasyanov
Arthur Darcet
Ben Bader
Expand Down
5 changes: 3 additions & 2 deletions aiohttp/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,9 @@ def run_app(app, *, host=None, port=None, path=None, sock=None,
pass

try:
print("======== Running on {} ========\n"
"(Press CTRL+C to quit)".format(', '.join(uris)))
if print:
print("======== Running on {} ========\n"
"(Press CTRL+C to quit)".format(', '.join(uris)))
loop.run_forever()
except (GracefulExit, KeyboardInterrupt): # pragma: no cover
pass
Expand Down
1 change: 1 addition & 0 deletions changes/2260.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run_app: Make print=None disable printing
3 changes: 2 additions & 1 deletion docs/web_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2400,7 +2400,8 @@ Utilities
``None`` for HTTP connection.

:param print: a callable compatible with :func:`print`. May be used
to override STDOUT output or suppress it.
to override STDOUT output or suppress it. Passing `None`
disables output.

:param int backlog: the number of unaccepted connections that the
system will allow before refusing new
Expand Down

0 comments on commit 7b20128

Please sign in to comment.