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 15cfdb6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
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
3 changes: 3 additions & 0 deletions aiohttp/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,9 @@ def run_app(app, *, host=None, port=None, path=None, sock=None,
app._set_loop(loop)
loop.run_until_complete(app.startup())

if print is None:
print = lambda *_: None

try:
make_handler_kwargs = dict()
if access_log_format is not None:
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 15cfdb6

Please sign in to comment.