summaryrefslogtreecommitdiff
path: root/monkey/monkey.py
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-01-26 19:02:57 +0100
committerAleš Smodiš <aless@guru.si>2015-08-11 14:26:01 +0200
commit74ed1cd233db9bb24aecedcbdf66bc66a5c905f9 (patch)
tree341a33a051761f52492db41a0d3a38ccdac35b54 /monkey/monkey.py
parent60dd33f144165771881f60acb44552fb37a7d47f (diff)
Remove a superfluous try/except block
Diffstat (limited to 'monkey/monkey.py')
-rwxr-xr-xmonkey/monkey.py11
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]