commit 66e0fb5140dcbcf013c1611d4b4422800514a921
parent 92add8aa40c9e7a295a72feb7780646582d3812b
Author: Marcel <MTRNord@users.noreply.github.com>
Date: Fri, 30 Dec 2016 19:53:27 +0100
Add missing cleanup at the end of uploading
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/__init__.py b/__init__.py
@@ -104,6 +104,8 @@ def _screencap(url, args_filepath, filepath, filename, bot, event):
try:
image_id = yield from bot._client.upload_image(image_data, filename=filename)
yield from bot._client.sendchatmessage(event.conv.id_, None, image_id=image_id)
+ os.unlink(filepath)
+ os.unlink(args_filepath)
except Exception as e:
logger.exception("upload failed: {}".format(url))
logger.exception("exception: {}".format(e))