Skip to content

Commit 46e5181

Browse files
committed
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
1 parent 34df7f6 commit 46e5181

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

kittens/transfer/librsync.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,9 @@ def close(self) -> None:
133133
self.get_remaining_output()
134134
self.src_file.close()
135135
count = 100
136-
while not self.finished:
136+
while not self.finished and count > 0:
137137
self()
138138
count -= 1
139-
if count == 0:
140-
raise Exception('Patching file did not receive enough input')
141139
self.dest_file.close()
142140
if self.overwrite_src:
143141
os.replace(self.dest_file.name, self.src_file.name)

0 commit comments

Comments
 (0)