retires: use range(1, retries)

Bug #1742249 reported by Joshua Powers
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-ubuntu
Confirmed
Low
Nish Aravamudan

Bug Description

Trying to debug code that is in a retry loop is not straightforward as it is. Having to see variables constantly add 1 to them, because range starts at 0 rather than 1 is unclear. Can I suggest replacing code like the following from build.py:

for i in range(retries+1):
...
"(attempt %d/%d)", i+1, retries+1,
...
if i < retries:

with the following:

for i in range(1, retries):
...
"(attempt %d/%d)", i, retries,
...
if i <= retries:

Tags: quality
Nish Aravamudan (nacc)
Changed in usd-importer:
status: New → Confirmed
assignee: nobody → Nish Aravamudan (nacc)
milestone: none → future
importance: Undecided → Low
Robie Basak (racb)
tags: added: quality
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.