[core] Validate retries values are non-negative (#11927)

Closes #11926
Authored by: Strkmn
master
Paul Storkman 9 hours ago committed by GitHub
parent 763ed06ee6
commit 1f4e1e85a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -261,9 +261,11 @@ def validate_options(opts):
elif value in ('inf', 'infinite'):
return float('inf')
try:
return int(value)
int_value = int(value)
except (TypeError, ValueError):
validate(False, f'{name} retry count', value)
validate_positive(f'{name} retry count', int_value)
return int_value
opts.retries = parse_retries('download', opts.retries)
opts.fragment_retries = parse_retries('fragment', opts.fragment_retries)

Loading…
Cancel
Save