Skip to content

Commit

Permalink
dropped app.router.add_subapp() #1592
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Kim committed Feb 8, 2017
1 parent b20a085 commit 5ed89d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ CHANGES
- Dropped: `aiohttp.protocol.HttpPrefixParser` #1590

- Dropped: Servers response's `.started`, `.start()` and `.can_start()` method #1591

- Dropped: Adding `sub app` via `app.router.add_subapp()` is deprecated
use `app.add_subapp()` instead #1592
13 changes: 0 additions & 13 deletions aiohttp/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ def __init__(self, *, logger=web_logger, loop=None,
router = web_urldispatcher.UrlDispatcher()
assert isinstance(router, AbstractRouter), router

# backward compatibility until full deprecation
router.add_subapp = _wrap_add_subbapp(self)

if debug is ...:
debug = loop.get_debug()

Expand Down Expand Up @@ -285,16 +282,6 @@ def __repr__(self):
return "<Application 0x{:x}>".format(id(self))


def _wrap_add_subbapp(app):
# backward compatibility

def add_subapp(prefix, subapp):
warnings.warn("Use app.add_subapp() instead", DeprecationWarning)
return app.add_subapp(prefix, subapp)

return add_subapp


def run_app(app, *, host='0.0.0.0', port=None,
shutdown_timeout=60.0, ssl_context=None,
print=print, backlog=128, access_log_format=None,
Expand Down
6 changes: 0 additions & 6 deletions tests/test_urldispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,12 +913,6 @@ def test_subapp_get_info(app, loop):
assert resource.get_info() == {'prefix': '/pre', 'app': subapp}


def test_subapp_backward_compatible(router, loop):
subapp = web.Application(loop=loop)
resource = router.add_subapp('/pre', subapp)
assert resource.get_info() == {'prefix': '/pre', 'app': subapp}


def test_subapp_url(app, loop):
subapp = web.Application(loop=loop)
resource = app.add_subapp('/pre', subapp)
Expand Down

0 comments on commit 5ed89d1

Please sign in to comment.