diff --git a/voussoirkit/spinal.py b/voussoirkit/spinal.py index d936c7c..d63b88b 100644 --- a/voussoirkit/spinal.py +++ b/voussoirkit/spinal.py @@ -501,11 +501,11 @@ def copy_file( destination_handle.write(data_chunk) results.written_bytes += data_bytes + callback_progress(destination, results.written_bytes, source_bytes) + if bytes_per_second is not None: bytes_per_second.limit(data_bytes) - callback_progress(destination, results.written_bytes, source_bytes) - if results.written_bytes == 0: # For zero-length files, we want to get at least one call in there. callback_progress(destination, results.written_bytes, source_bytes)