donate-cpu.py: Fix possible usage of none type variable
"bandwidth_limit" is None by default and therefore can not be used for string concatenation in this case.
This commit is contained in:
parent
e3db99a16e
commit
dfaba30290
|
@ -374,11 +374,12 @@ for arg in sys.argv[1:]:
|
||||||
print('Thank you!')
|
print('Thank you!')
|
||||||
if not checkRequirements():
|
if not checkRequirements():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if subprocess.call(['wget', '--limit-rate=' + bandwidth_limit, '-q', '--spider', 'cppcheck.osuosl.org']) is 2:
|
if bandwidth_limit and isinstance(bandwidth_limit, str):
|
||||||
print('Error: Bandwidth limit value "' + bandwidth_limit + '" is invalid.')
|
if subprocess.call(['wget', '--limit-rate=' + bandwidth_limit, '-q', '--spider', 'cppcheck.osuosl.org']) is 2:
|
||||||
sys.exit(1)
|
print('Error: Bandwidth limit value "' + bandwidth_limit + '" is invalid.')
|
||||||
else:
|
sys.exit(1)
|
||||||
print('Bandwidth-limit: ' + bandwidth_limit)
|
else:
|
||||||
|
print('Bandwidth-limit: ' + bandwidth_limit)
|
||||||
if not os.path.exists(workpath):
|
if not os.path.exists(workpath):
|
||||||
os.mkdir(workpath)
|
os.mkdir(workpath)
|
||||||
cppcheckPath = workpath + '/cppcheck'
|
cppcheckPath = workpath + '/cppcheck'
|
||||||
|
|
Loading…
Reference in New Issue