From 45253b398cf37fbe72584c936a9cf7e1587c6f39 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Fri, 6 Mar 2020 12:51:59 +0100 Subject: [PATCH] archive: remove unneeded 'found' flag This var isn't needed - just using for/else is better --- ubuntutools/archive.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ubuntutools/archive.py b/ubuntutools/archive.py index 87e1ed5..8705102 100644 --- a/ubuntutools/archive.py +++ b/ubuntutools/archive.py @@ -532,7 +532,6 @@ class SourcePackage(object): arch = None for bpph in self.lp_spph.getBinaries(arch=arch, name=name, ext=ext): - found = False fname = bpph.getFileName() fsha1 = bpph.binaryFileSha1(fname) fsha256 = bpph.binaryFileSha256(fname) @@ -540,14 +539,12 @@ class SourcePackage(object): for url in self._binary_urls(fname, bpph): try: if self._download_file(url, fname, False, fsize): - found = True + total += 1 break except HTTPError as e: Logger.info('HTTP Error %i: %s', e.code, str(e)) except URLError as e: Logger.info('URL Error: %s', e.reason) - if found: - total += 1 else: Logger.info("Could not download from any location: %s", fname) return total