diff options
Diffstat (limited to 'monkey/monkey.py')
-rwxr-xr-x | monkey/monkey.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/monkey/monkey.py b/monkey/monkey.py index 8faad1a..5d26c6e 100755 --- a/monkey/monkey.py +++ b/monkey/monkey.py @@ -63,15 +63,12 @@ def fix(name, code, edits, aux_code='', timeout=30, debug=False): for line, (before, after) in path: print('line ' + str(line) + ':\t' + stringify(before) + ' → ' + stringify(after)) - # if the code is correct, we are done - try: - if test(name, code + '\n' + aux_code): - return code, path, total_time, n_tested - except: - pass + # If the code is correct, we are done. + if test(name, code + '\n' + aux_code): + return code, path, total_time, n_tested n_tested += 1 - # otherwise generate new solutions + # Otherwise generate new solutions. rule_no = 0 for start, end in rules: rule = lines[start:end] |