Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AttackingOrDefending authored Feb 3, 2025
1 parent 0416c39 commit 4e87198
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/engine_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ def play_move(self,
best_move = self.search(board, time_limit, can_ponder, draw_offered, best_move)
except chess.engine.EngineError as error:
BadMove = (chess.IllegalMoveError, chess.InvalidMoveError)
if any(isinstance(e, BadMove) for e in error.args):
logger.error("Ending game due to bot attempting an illegal move.")
logger.error(error)
game_ender = li.abort if game.is_abortable() else li.resign
game_ender(game.id)
return
raise
if not any(isinstance(e, BadMove) for e in error.args):
raise
logger.error("Ending game due to bot attempting an illegal move.")
logger.error(error)
game_ender = li.abort if game.is_abortable() else li.resign
game_ender(game.id)
return

# Heed min_time
elapsed = setup_timer.time_since_reset()
Expand Down

0 comments on commit 4e87198

Please sign in to comment.