fix behavior with infinite retries
All checks were successful
Python package / lint (push) Successful in 7s
Publish Python 🐍 distribution 📦 to PyPI and TestPyPI / Build distribution 📦 (push) Successful in 9s
Publish Python 🐍 distribution 📦 to PyPI and TestPyPI / Publish Python 🐍 distribution 📦 to PyPI (push) Successful in 5s
Publish Python 🐍 distribution 📦 to PyPI and TestPyPI / Publish Python 🐍 distribution 📦 to TestPyPI (push) Successful in 4s

This commit is contained in:
Brendan Haines 2024-09-14 17:50:59 -06:00
parent 4671cf5fac
commit e02737abd1

View File

@ -59,7 +59,8 @@ def wrap(command: List[str], config: Path, retries: int, version):
if retries < 0: if retries < 0:
raise ValueError("Invalid number of retries specified") raise ValueError("Invalid number of retries specified")
for attempt in range(retries + 1): attempt = 0
while attempt <= retries:
# run the command # run the command
result = subprocess.run( result = subprocess.run(
" ".join(command), " ".join(command),
@ -101,6 +102,8 @@ def wrap(command: List[str], config: Path, retries: int, version):
# only retry on failure # only retry on failure
break break
attempt += 1
sys.exit(result.returncode) sys.exit(result.returncode)