mirror of
https://github.com/httpie/cli.git
synced 2025-03-13 06:18:33 +01:00
Deduplicate downloader clean-up logic
This commit is contained in:
parent
e375c259e8
commit
a367a55173
@ -284,14 +284,15 @@ class Downloader:
|
||||
assert not self.finished
|
||||
self.finished = True
|
||||
self.status.finished()
|
||||
# we created the output file in the process, closing it now.
|
||||
if self._output_file_created:
|
||||
self._output_file.close()
|
||||
self._cleanup()
|
||||
|
||||
def failed(self):
|
||||
self.status.terminate()
|
||||
self._cleanup()
|
||||
|
||||
def _cleanup(self):
|
||||
if self._output_file_created:
|
||||
self._output_file.close()
|
||||
self.status.terminate()
|
||||
|
||||
@property
|
||||
def is_interrupted(self) -> bool:
|
||||
|
Loading…
Reference in New Issue
Block a user