Prevent double-deleting file in downloads

This commit is contained in:
Florian Bruhin 2014-06-19 21:27:57 +02:00
parent 684154dd7d
commit 0dfdd422a2

View File

@ -186,7 +186,7 @@ class DownloadItem(QObject):
self.reply.deleteLater()
if self.fileobj is not None:
self.fileobj.close()
if self.filename is not None:
if self.filename is not None and os.path.exists(self.filename):
os.remove(self.filename)
self.finished.emit()