donate-cpu.py: Fix two pylint warnings (#2327)

Line 102: Comparison to literal
Line 117: Unnecessary "else" after "break"
This commit is contained in:
Sebastian 2019-11-04 18:36:14 +01:00 committed by GitHub
parent 06ea1a2b53
commit 83caedec8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -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') + '.')