Skip to content

Commit 23c36e7

Browse files
committed
Remove use of assert for failure mode detection
Closes #27
1 parent 9f8a039 commit 23c36e7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

annotator/__main__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ def truncate_pv(board, pv):
283283
"""
284284

285285
for move in pv:
286-
assert board.is_legal(move)
286+
if not board.is_legal(move):
287+
raise AssertionError
287288
board.push(move)
288289

289290
if board.is_game_over(claim_draw=True):
@@ -588,7 +589,8 @@ def analyze_game(game, arg_gametime, enginepath, threads):
588589
if game.board().uci_variant != "chess":
589590
try:
590591
engine_variants = engine.options["UCI_Variant"].var
591-
assert game.board().uci_variant in engine_variants
592+
if not game.board().uci_variant in engine_variants:
593+
raise AssertionError
592594
except KeyError:
593595
message = "UCI_Variant option is not supported by the " \
594596
"engine and this is a variant game."

0 commit comments

Comments
 (0)