Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 9594167

Browse files
William Douglasbryteise
authored andcommitted
Add fixes for flake8 warnings
Signed-off-by: William Douglas <william.douglas@intel.com>
1 parent c62c42a commit 9594167

4 files changed

Lines changed: 3 additions & 17 deletions

File tree

autospec/count.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,8 @@ def sanitize_counts():
7171
"""Validate test counts are within sane bounds."""
7272
global total_tests
7373
global total_pass
74-
global total_fail
75-
global total_xfail
76-
global total_skip
7774
global counted_tests
7875
global counted_pass
79-
global counted_fail
80-
global counted_xfail
81-
global counted_skip
8276
if total_tests > 0 and total_pass == 0:
8377
total_pass = total_tests - total_fail - total_skip - total_xfail
8478

@@ -170,7 +164,6 @@ def parse_log(log, pkgname=''):
170164
global total_fail
171165
global total_xfail
172166
global total_skip
173-
global counted_tests
174167
global counted_pass
175168
global counted_fail
176169
global counted_xfail

autospec/license.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ def add_license(lic, translations, blacklist):
5555
presence in the blacklist. Returns False if no license were added, True
5656
otherwise.
5757
"""
58-
global licenses
59-
global license_files
6058
lic = lic.strip().strip(',')
6159
result = False
6260

@@ -208,9 +206,6 @@ def scan_for_licenses(srcdir, config, pkg_name):
208206

209207
def load_specfile(specfile):
210208
"""Get licenses from the specfile content."""
211-
global licenses
212-
global license_files
213-
global hashes
214209
specfile.licenses = licenses if licenses else [default_license]
215210
specfile.license_files = sorted(license_files)
216211
specfile.hashes = hashes

autospec/pkg_integrity.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def __init__(self, pubkey=None, home=None):
9696
util.write_out(os.path.join(_gpghome, 'gpg.conf'), GNUPGCONF)
9797
if pubkey is not None:
9898
args = self.args + ['--import', pubkey]
99-
output, err, code = self.exec_cmd(args)
99+
_, err, code = self.exec_cmd(args)
100100
if code == -9:
101101
raise Exception('Command {} timeout after {} seconds'.format(' '.join(args), CMD_TIMEOUT))
102102
elif code != 0:
@@ -212,16 +212,15 @@ def quit():
212212
@staticmethod
213213
def calc_sum(filepath, digest_algo):
214214
"""Use digest_algo to calculate block sum of a file."""
215-
BLOCK_SIZE = 4096
215+
block_size = 4096
216216
with open(filepath, 'rb') as fp:
217217
digest = digest_algo()
218-
for block in iter(lambda: fp.read(BLOCK_SIZE), b''):
218+
for block in iter(lambda: fp.read(block_size), b''):
219219
digest.update(block)
220220
return digest.hexdigest()
221221

222222
def print_result(self, result, err_msg=''):
223223
"""Display verification results."""
224-
global EMAIL
225224
package_name = ''
226225
if self.url is not None:
227226
package_name = os.path.basename(self.url)

autospec/util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ def _file_write(self, s):
156156

157157
def translate(package):
158158
"""Convert terms to their alternate definition."""
159-
global dictionary
160159
for item in dictionary:
161160
if item.startswith(package + "="):
162161
return item.split("=")[1]

0 commit comments

Comments
 (0)