Delete the temp file after uploading

test
Jason Robinson 2021-01-01 03:02:31 +02:00
rodzic e4db91503b
commit 2fe45a35f0
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -144,6 +144,8 @@ class MatrixRoomMessage(Post, MatrixEntityMixin):
logger.warning("MatrixRoomMessage.pre_send | Failed to upload image %s: %s",
url, ex)
continue
finally:
os.unlink(image_file)
# Replace in raw content
try:
logger.debug("MatrixRoomMessage.pre_send | Got response %s", response.json())