Skip to content

Commit

Permalink
Compare to Status.SUCCESS instead of Status.FAILURE.
Browse files Browse the repository at this point in the history
  • Loading branch information
dstein64 committed Apr 1, 2021
1 parent 3538fbd commit b69b09a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vimgolf/vimgolf.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def play(challenge, workspace):
'-W', logfile, # keylog file (overwrites existing)
infile,
]
if VimRunner.run(play_args) == Status.FAILURE:
if VimRunner.run(play_args) != Status.SUCCESS:
return Status.FAILURE

correct = filecmp.cmp(infile, outfile)
Expand Down Expand Up @@ -517,7 +517,7 @@ def play(challenge, workspace):
elif selection == 'd':
# diffsplit is used instead of 'vim -d' to avoid the "2 files to edit" message.
diff_args = ['-n', infile, '-c', 'vertical diffsplit {}'.format(outfile)]
if VimRunner.run(diff_args) == Status.FAILURE:
if VimRunner.run(diff_args) != Status.SUCCESS:
return Status.FAILURE
elif selection == 'w':
upload_status = upload_result(challenge.id, challenge.api_key, raw_keys)
Expand Down Expand Up @@ -805,7 +805,7 @@ def diff(challenge_id):
f.write(out_text)
# diffsplit is used instead of 'vim -d' to avoid the "2 files to edit" message.
diff_args = ['-n', infile, '-c', 'vertical diffsplit {}'.format(outfile)]
if VimRunner.run(diff_args) == Status.FAILURE:
if VimRunner.run(diff_args) != Status.SUCCESS:
return Status.FAILURE
return Status.SUCCESS

Expand Down

0 comments on commit b69b09a

Please sign in to comment.