From e6b17c5d97fce902fb1c05d82aab0abadff54f24 Mon Sep 17 00:00:00 2001 From: Theo Rozier Date: Tue, 15 Jun 2021 21:53:03 +0200 Subject: [PATCH] Urgent fix to download's progress callback (#14). --- portablemc.py | 2 +- portablemc_core.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/portablemc.py b/portablemc.py index 97ab0364..8ae8492a 100644 --- a/portablemc.py +++ b/portablemc.py @@ -602,7 +602,7 @@ def download_file(self, start_size += read_len if progress_callback is not None: - progress_callback(dl_size, 0 if entry.size else entry.size, start_size, total_size) + progress_callback(dl_size, 0 if entry.size is None else entry.size, start_size, total_size) if entry.size is not None and dl_size != entry.size: raise DownloadCorruptedError("invalid_size") diff --git a/portablemc_core.py b/portablemc_core.py index 39790712..97735df7 100644 --- a/portablemc_core.py +++ b/portablemc_core.py @@ -604,7 +604,7 @@ def download_file(self, start_size += read_len if progress_callback is not None: - progress_callback(dl_size, 0 if entry.size else entry.size, start_size, total_size) + progress_callback(dl_size, 0 if entry.size is None else entry.size, start_size, total_size) if entry.size is not None and dl_size != entry.size: raise DownloadCorruptedError("invalid_size")