try/except file removal

This commit is contained in:
Gordon Shumway 2019-03-24 17:03:15 -04:00 committed by GitHub
parent fd6599cae9
commit f76b2abac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -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]