Skip to content

Commit

Permalink
Fix #1947: don't raise DeprecationWarning inside on_startup() handler…
Browse files Browse the repository at this point in the history
… for run_app()
  • Loading branch information
asvetlov committed Jun 14, 2017
1 parent ed28add commit 8f3d8f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Changes

- Use CIMultiDict for ClientRequest.skip_auto_headers #1970

- Fix wrong startup sequence: test server doesn't raise
- Fix wrong startup sequence: test server and `run_app()` are not raise
`DeprecationWarning` now #1947

-
Expand Down
5 changes: 3 additions & 2 deletions aiohttp/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,15 @@ def run_app(app, *, host=None, port=None, path=None, sock=None,
if loop is None:
loop = asyncio.get_event_loop()

app._set_loop(loop)
loop.run_until_complete(app.startup())

make_handler_kwargs = dict()
if access_log_format is not None:
make_handler_kwargs['access_log_format'] = access_log_format
handler = app.make_handler(loop=loop, access_log=access_log,
**make_handler_kwargs)

loop.run_until_complete(app.startup())

scheme = 'https' if ssl_context else 'http'
base_url = URL('{}://localhost'.format(scheme)).with_port(port)

Expand Down

0 comments on commit 8f3d8f2

Please sign in to comment.