diff --git a/delete_closed_or_merged_pr_forks.py b/delete_closed_or_merged_pr_forks.py index 2ab2dbf..76f7569 100644 --- a/delete_closed_or_merged_pr_forks.py +++ b/delete_closed_or_merged_pr_forks.py @@ -38,8 +38,7 @@ def read_results_data(json_file_name: str): data = read_results_data(file) project_name: str = data['project_name'] print(f'loading project: {project_name}') - pull_url = data['pull_request'] - if pull_url == '': + if (pull_url := data['pull_request']) == '': continue diff --git a/jhipster_security_fix.py b/jhipster_security_fix.py index 0b16ae2..31639d0 100644 --- a/jhipster_security_fix.py +++ b/jhipster_security_fix.py @@ -70,8 +70,7 @@ async def do_fix_vulnerable_file(self, project_name: str, file: str, expected_fi async with aiofiles.open(file, newline='') as vulnerableFile: contents: str = await vulnerableFile.read() - new_contents = await self.do_fix_file_contents(contents) - if new_contents == contents: + if (new_contents := await self.do_fix_file_contents(contents)) == contents: return 0 async with aiofiles.open(file, 'w', newline='') as vulnerableFile: