From f76b2abac1b4468f945bc1d2642ca433af51c2c2 Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Sun, 24 Mar 2019 17:03:15 -0400 Subject: [PATCH] try/except file removal --- ASCII/plugin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ASCII/plugin.py b/ASCII/plugin.py index 1a9c368..bcbbc0d 100644 --- a/ASCII/plugin.py +++ b/ASCII/plugin.py @@ -237,7 +237,10 @@ class ASCII(callbacks.Plugin): # open image and convert to grayscale image = Image.open(filename).convert('L') image2 = Image.open(filename) - os.remove(filename) + try: + os.remove(filename) + except: + pass irc.reply("Please be patient while I render the image into ASCII characters and colorize the output.") # store dimensions W, H = image.size[0], image.size[1] @@ -326,7 +329,10 @@ class ASCII(callbacks.Plugin): # open image and convert to grayscale image = Image.open(filename).convert('L') image2 = Image.open(filename) - os.remove(filename) + try: + os.remove(filename) + except: + pass irc.reply("Please be patient while I render the image into ASCII characters and colorize the output.") # store dimensions W, H = image.size[0], image.size[1]