From: Michael Tremer Date: Thu, 28 Feb 2013 18:43:41 +0000 (+0100) Subject: Check if there is a progressbar, when calling finish. X-Git-Tag: 0.9.25~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=92470f482414e7f77526368d123ff0e176789439;p=pakfire.git Check if there is a progressbar, when calling finish. --- diff --git a/python/pakfire/transport.py b/python/pakfire/transport.py index ca799a3a2..c7c5c34a4 100644 --- a/python/pakfire/transport.py +++ b/python/pakfire/transport.py @@ -159,7 +159,8 @@ class PakfireHubTransportUploader(object): self.send_file(upload_id, progress_callback=progress.update) except: - progress.finish() + if progress: + progress.finish() # Remove broken upload from server. if upload_id: @@ -169,7 +170,8 @@ class PakfireHubTransportUploader(object): raise else: - progress.finish() + if progress: + progress.finish() # If no exception was raised, the upload # has finished.