fixed bug in download not enough disk space condition (#35)

bug:
used undeclared variable in download.py.
when the disk space not enough NameError occured.
This commit is contained in:
sisminnmaw 2024-08-23 00:10:47 +09:00 committed by GitHub
parent b4af8c0e00
commit 49f2bbbaeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -271,9 +271,10 @@ class ResumableDownloader:
additional_size = self.total_size - self.downloaded_size
if not self.has_disk_space(additional_size):
M = 1024 * 1024 # noqa
print(
f"Not enough disk space to download `{self.output_file}`. "
f"Required: {(additional_size / M):.2f} MB"
f"Required: {(additional_size // M):.2f} MB"
)
raise ValueError(
f"Not enough disk space to download `{self.output_file}`"