Skip to content

Commit 83caede

Browse files
authored
donate-cpu.py: Fix two pylint warnings (cppcheck-opensource#2327)
Line 102: Comparison to literal Line 117: Unnecessary "else" after "break"
1 parent 06ea1a2 commit 83caede

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tools/donate-cpu.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
if not check_requirements():
100100
sys.exit(1)
101101
if bandwidth_limit and isinstance(bandwidth_limit, str):
102-
if subprocess.call(['wget', '--limit-rate=' + bandwidth_limit, '-q', '--spider', 'cppcheck1.osuosl.org']) is 2:
102+
if subprocess.call(['wget', '--limit-rate=' + bandwidth_limit, '-q', '--spider', 'cppcheck1.osuosl.org']) == 2:
103103
print('Error: Bandwidth limit value "' + bandwidth_limit + '" is invalid.')
104104
sys.exit(1)
105105
else:
@@ -117,8 +117,7 @@
117117
if packages_processed >= max_packages:
118118
print('Processed the specified number of {} package(s). Exiting now.'.format(max_packages))
119119
break
120-
else:
121-
print('Processing package {} of the specified {} package(s).'.format(packages_processed + 1, max_packages))
120+
print('Processing package {} of the specified {} package(s).'.format(packages_processed + 1, max_packages))
122121
packages_processed += 1
123122
if stop_time:
124123
print('stop_time:' + stop_time + '. Time:' + time.strftime('%H:%M') + '.')

0 commit comments

Comments
 (0)