From eb4169d6af67a73774813bb52dcb487ff2feab06 Mon Sep 17 00:00:00 2001 From: nex Date: Thu, 16 Mar 2023 23:31:38 +0000 Subject: [PATCH] fix filenotfound error --- cogs/other.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cogs/other.py b/cogs/other.py index 47967a5..0b31a7a 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -853,8 +853,9 @@ class OtherCog(commands.Cog): return False while should_loop(): - last_3_sizes.pop(-1) - last_3_sizes.append(os.stat(target_fn).st_size) + if os.path.exists(target_fn): + last_3_sizes.pop(-1) + last_3_sizes.append(os.stat(target_fn).st_size) sleep(3) with open(target_fn, "rb") as f: