Skip to content

Commit b064105

Browse files
committed
upgrade to async syntax
1 parent 554af29 commit b064105

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

www/app.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
def index(request):
1818
return web.Response(body=b'<h1>Awesome</h1>')
1919

20-
@asyncio.coroutine
21-
def init(loop):
20+
async def init(loop):
2221
app = web.Application(loop=loop)
2322
app.router.add_route('GET', '/', index)
24-
srv = yield from loop.create_server(app.make_handler(), '127.0.0.1', 9000)
23+
srv = await loop.create_server(app.make_handler(), '127.0.0.1', 9000)
2524
logging.info('server started at http://127.0.0.1:9000...')
2625
return srv
2726

0 commit comments

Comments
 (0)