Tiny style fixes

This commit is contained in:
Dmitry D. Chernov 2019-02-07 06:55:34 +10:00
parent c8f16a4e89
commit fc2977fc0d
2 changed files with 7 additions and 9 deletions

View File

@ -75,12 +75,10 @@ def strip_text(text, entities):
def retry_range(retries): def retry_range(retries):
""" """
Generates an integer sequence starting from 1. If `retries` is Generates an integer sequence starting from 1. If `retries` is
negative or ``None`` then sequence is infinite, otherwise it will not a zero or a positive integer value, the sequence will be
end at `retries + 1`. infinite, otherwise it will end at `retries + 1`.
""" """
yield 1 yield 1
if retries is None:
retries = -1
attempt = 0 attempt = 0
while attempt != retries: while attempt != retries:
attempt += 1 attempt += 1