Skip to content

Commit

Permalink
Force engine termination if clean termination fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Torom committed May 13, 2023
1 parent dcbc381 commit 303f587
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lichess_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ def stop_pondering(self) -> None:
self.engine.analysis(self.board, chess.engine.Limit(time=0.001))

def end_game(self) -> None:
self.engine.quit()
try:
self.engine.quit()
except TimeoutError:
print('Enginge could not be terminated cleanly.')

self.engine.close()

for book_reader in self.book_readers:
Expand Down

0 comments on commit 303f587

Please sign in to comment.