Skip to content

Commit

Permalink
Ignore UnboundLocalError if runner doesn't get defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluenix2 committed Jan 15, 2021
1 parent 2c79925 commit 5044da0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aiohttp/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,11 @@ async def main_runner() -> None:
while True:
await asyncio.sleep(delay)
finally:
await runner.cleanup()
try:
await runner.cleanup()
except UnboundLocalError:
# An error was raised before runner had been defined
pass

try:
main_task = loop.create_task(main_runner())
Expand Down

0 comments on commit 5044da0

Please sign in to comment.