Dont rise an exception in patchfile close()

This allows partial transfers, by overwriting the dest file with the
tempfile even if the transfer was not completed
This commit is contained in:
Kovid Goyal
2021-11-17 14:34:14 +05:30
parent 34df7f6bc8
commit 46e51811e8

View File

@@ -133,11 +133,9 @@ class PatchFile(StreamingJob):
self.get_remaining_output()
self.src_file.close()
count = 100
while not self.finished:
while not self.finished and count > 0:
self()
count -= 1
if count == 0:
raise Exception('Patching file did not receive enough input')
self.dest_file.close()
if self.overwrite_src:
os.replace(self.dest_file.name, self.src_file.name)