From 5a1c75f8e4bbdd6f306ad310bf1fa2d545b05edc Mon Sep 17 00:00:00 2001 From: nex Date: Mon, 9 Jan 2023 14:45:57 +0000 Subject: [PATCH] Fix keyerror --- cogs/other.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cogs/other.py b/cogs/other.py index 88c5ed9..b2b8914 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -400,10 +400,8 @@ class OtherCog(commands.Cog): return_when=asyncio.FIRST_COMPLETED, ) done_tasks = done - done = done_tasks or pending - done = pending or done_tasks try: - done = done.pop() + done = done_tasks.pop() except KeyError: return await ctx.respond( "Something went wrong. Try again?\n" @@ -418,7 +416,7 @@ class OtherCog(commands.Cog): await asyncio.sleep(1) await ctx.edit(content=f"Preparing to screenshot {friendly_url}... (16%)") - okay = await pending.pop() + okay = await (pending or done_tasks).pop() if okay is not True: return await ctx.edit( content="That domain is blacklisted, doesn't exist, or there was no answer from the DNS server."