Skip to content

Commit e43f65c

Browse files
committed
http_charfinder.py with async/await
1 parent aeee419 commit e43f65c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

18b-async-await/charfinder/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
charfinder_index.pickle

18b-async-await/charfinder/http_charfinder.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ def home(request): # <1>
4545

4646

4747
# BEGIN HTTP_CHARFINDER_SETUP
48-
@asyncio.coroutine
49-
def init(loop, address, port): # <1>
48+
async def init(loop, address, port): # <1>
5049
app = web.Application(loop=loop) # <2>
5150
app.router.add_route('GET', '/', home) # <3>
5251
handler = app.make_handler() # <4>
53-
server = yield from loop.create_server(handler,
52+
server = await loop.create_server(handler,
5453
address, port) # <5>
5554
return server.sockets[0].getsockname() # <6>
5655

0 commit comments

Comments
 (0)