Skip to content

Commit

Permalink
Fix #1978: Deprecate on_loop_available (#1989)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov authored Jun 19, 2017
1 parent 5562f9a commit 0472954
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ Changes

- Fix BadStatusLine caused by extra `CRLF` after `POST` data #1792

-

- Deprecate undocumented app.on_loop_available signal #1978

-

-


2.1.0 (2017-05-26)
------------------
Expand Down
2 changes: 2 additions & 0 deletions aiohttp/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ def add_subapp(self, prefix, subapp):

@property
def on_loop_available(self):
warnings.warn("on_loop_available is deprecated and will be removed",
DeprecationWarning, stacklevel=2)
return self._on_loop_available

@property
Expand Down
3 changes: 2 additions & 1 deletion tests/test_web_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def test_on_loop_available(loop):
app = web.Application()

cb = mock.Mock()
app.on_loop_available.append(cb)
with pytest.warns(DeprecationWarning):
app.on_loop_available.append(cb)

app._set_loop(loop)
cb.assert_called_with(app)
Expand Down

0 comments on commit 0472954

Please sign in to comment.