Skip to content

Commit

Permalink
Fix pyling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed Sep 15, 2020
1 parent aa6de55 commit a93418d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions mx.py
Expand Up @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions mx_bisect.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit a93418d

Please sign in to comment.