From a93418d898b0cc00bb866f170d14e5df8961db08 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Tue, 15 Sep 2020 13:59:24 +0300 Subject: [PATCH] Fix pyling issues --- mx.py | 5 ++--- mx_bisect.py | 12 ++++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/mx.py b/mx.py index 1de60922..3d4ea9c5 100755 --- a/mx.py +++ b/mx.py @@ -14204,9 +14204,8 @@ def __exit__(self, exc_type, exc_value, traceback): except: if not exists(self.target): raise - else: - # Silently assume another process won the race to create self.target - pass + # Silently assume another process won the race to create self.target + pass rmtree(self._workspace) diff --git a/mx_bisect.py b/mx_bisect.py index 571cf1f7..6b0fd9f5 100644 --- a/mx_bisect.py +++ b/mx_bisect.py @@ -456,8 +456,8 @@ def commit_info(self, commit_hash, formatter): def reset_original_commit(self): if self.original_commit: - subprocess.run(['git', 'checkout', '-q', self.original_branch]) - subprocess.run(['git', 'reset', '--hard', self.original_commit]) + subprocess.run(['git', 'checkout', '-q', self.original_branch], check=True) + subprocess.run(['git', 'reset', '--hard', self.original_commit], check=True) class BisectStrategy: @@ -766,14 +766,14 @@ def _generate_tmp_test_commits(failure_rate=5): for i in range(10): with open(script_name, 'w') as f: f.write('echo ' + '.' * i + '\n') - subprocess.run(['git', 'add', script_name]) - subprocess.run(['git', 'commit', '-m', 'Good script ' + str(i)]) + subprocess.run(['git', 'add', script_name], check=True) + subprocess.run(['git', 'commit', '-m', 'Good script ' + str(i)], check=True) for i in range(20): with open(script_name, 'w') as f: f.write('if [ $(( ( RANDOM % ' + str( failure_rate) + ' ) + 1 )) == 1 ]\n then\n echo "An error occurred" 1>&2 \n exit 1\n else echo ' + '.' * i + '\n fi') - subprocess.run(['git', 'add', script_name]) - subprocess.run(['git', 'commit', '-m', 'Failure script ' + str(i)]) + subprocess.run(['git', 'add', script_name], check=True) + subprocess.run(['git', 'commit', '-m', 'Failure script ' + str(i)], check=True) return script_name