fix behavior with infinite retries
All checks were successful
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
Python package / lint (push) Successful in 7s

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