mirror of
https://gitlab.com/RemixDev/deemix-py.git
synced 2024-12-28 02:26:14 +00:00
Added missing unlink on error
This commit is contained in:
parent
f530a4e89f
commit
d8ecb244f5
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -28,6 +28,7 @@ yarn-error.log*
|
|||
# Private configs
|
||||
/config.py
|
||||
/test.py
|
||||
/config/
|
||||
|
||||
#build files
|
||||
/build
|
||||
|
|
|
@ -329,6 +329,7 @@ class Downloader:
|
|||
with open(writepath, 'wb') as stream:
|
||||
streamTrack(stream, track, downloadObject=self.downloadObject, listener=self.listener)
|
||||
except requests.exceptions.HTTPError as e:
|
||||
if writepath.is_file(): writepath.unlink()
|
||||
raise DownloadFailed('notAvailable', track) from e
|
||||
except OSError as e:
|
||||
if writepath.is_file(): writepath.unlink()
|
||||
|
|
Loading…
Reference in a new issue