From 83caedec8a7966b968948e44679bf4cf32fcf3ef Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 4 Nov 2019 18:36:14 +0100 Subject: [PATCH] donate-cpu.py: Fix two pylint warnings (#2327) Line 102: Comparison to literal Line 117: Unnecessary "else" after "break" --- tools/donate-cpu.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/donate-cpu.py b/tools/donate-cpu.py index 457608975..cb376f3ad 100755 --- a/tools/donate-cpu.py +++ b/tools/donate-cpu.py @@ -99,7 +99,7 @@ print('Thank you!') if not check_requirements(): sys.exit(1) if bandwidth_limit and isinstance(bandwidth_limit, str): - if subprocess.call(['wget', '--limit-rate=' + bandwidth_limit, '-q', '--spider', 'cppcheck1.osuosl.org']) is 2: + if subprocess.call(['wget', '--limit-rate=' + bandwidth_limit, '-q', '--spider', 'cppcheck1.osuosl.org']) == 2: print('Error: Bandwidth limit value "' + bandwidth_limit + '" is invalid.') sys.exit(1) else: @@ -117,8 +117,7 @@ while True: if packages_processed >= max_packages: print('Processed the specified number of {} package(s). Exiting now.'.format(max_packages)) break - else: - print('Processing package {} of the specified {} package(s).'.format(packages_processed + 1, max_packages)) + print('Processing package {} of the specified {} package(s).'.format(packages_processed + 1, max_packages)) packages_processed += 1 if stop_time: print('stop_time:' + stop_time + '. Time:' + time.strftime('%H:%M') + '.')