Skip to content

Commit e96ed58

Browse files
committed
run_app: make print=None disable printing
1 parent c7e8356 commit e96ed58

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

CONTRIBUTORS.txt

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Andrew Leech
2929
Andrew Lytvyn
3030
Andrew Svetlov
3131
Andrii Soldatenko
32+
Antoine Pietri
3233
Anton Kasyanov
3334
Arthur Darcet
3435
Ben Bader

aiohttp/web.py

+3
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ def run_app(app, *, host=None, port=None, path=None, sock=None,
422422
app._set_loop(loop)
423423
loop.run_until_complete(app.startup())
424424

425+
if print is None:
426+
print = lambda *args, **kwargs: None
427+
425428
try:
426429
make_handler_kwargs = dict()
427430
if access_log_format is not None:

changes/2260.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
run_app: Make print=None disable printing

docs/web_reference.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -2400,7 +2400,8 @@ Utilities
24002400
``None`` for HTTP connection.
24012401

24022402
:param print: a callable compatible with :func:`print`. May be used
2403-
to override STDOUT output or suppress it.
2403+
to override STDOUT output or suppress it. Passing `None`
2404+
disables output.
24042405

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

0 commit comments

Comments
 (0)