From e512c6929e105b4cbff4168a6f88efde2cfaa20c Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 30 Jan 2021 13:00:59 -0800 Subject: [PATCH] abbreviate some use of enumerate() --- ci/deploy.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/deploy.py b/ci/deploy.py index 5887eca92..9b841c135 100644 --- a/ci/deploy.py +++ b/ci/deploy.py @@ -52,8 +52,8 @@ def upload(version: str, path: str, name: Optional[str] = None) -> str: '--upload-file', path, target], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) log.info('Curl response:') - for i, line in enumerate(proc.stdout.split('\n')): - log.info(f' {(i + 1):3}: {line}') + for i, line in enumerate(proc.stdout.split('\n'), 1): + log.info(f' {i:3}: {line}') proc.check_returncode() resp = proc.stdout.split('\n')[-1] @@ -93,8 +93,8 @@ def main(args: [str]) -> int: if os.path.exists('/etc/os-release'): with open('/etc/os-release') as f: log.info('/etc/os-release:') - for i, line in enumerate(f): - log.info(f' {i + 1}: {line[:-1]}') + for i, line in enumerate(f, 1): + log.info(f' {i}: {line[:-1]}') # bail out early if we do not have release-cli to avoid uploading assets that # become orphaned when we fail to create the release -- 2.40.0