From e54b80b3c9f1ade0a79dde6b6e5e95401ee371f6 Mon Sep 17 00:00:00 2001 From: Twentysix Date: Mon, 15 Feb 2016 09:37:04 +0100 Subject: [PATCH] Cleanup cache fix --- cogs/audio.py | 5 ++++- cogs/general.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cogs/audio.py b/cogs/audio.py index de0bebf5e..1b23a4551 100644 --- a/cogs/audio.py +++ b/cogs/audio.py @@ -391,7 +391,10 @@ class Audio: def empty_cache(self): files = os.listdir("data/audio/cache") for f in files: - os.unlink("data/audio/cache/" + f) + try: + os.unlink("data/audio/cache/" + f) + except PermissionError: # In case it tries to delete the file that it's currently playing + pass def cache_size(self): total = [os.path.getsize("data/audio/cache/" + f) for f in os.listdir("data/audio/cache")] diff --git a/cogs/general.py b/cogs/general.py index aef8a356b..2d2ec62d4 100644 --- a/cogs/general.py +++ b/cogs/general.py @@ -202,7 +202,6 @@ class General: Usage example: poll Is this a poll?;Yes;No;Maybe""" message = ctx.message - print(text) if len(text) == 1: if text[0].lower() == "stop": await self.endpoll(message)