From fb998a8e7c03819c06cabd1fbc78295b3e11631a Mon Sep 17 00:00:00 2001 From: Tanmay Garg <40921153+tanmay2004@users.noreply.github.com> Date: Sat, 26 Sep 2020 09:09:10 +0530 Subject: [PATCH] Update __init__.py --- chess/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chess/__init__.py b/chess/__init__.py index 5c8049d4b..db540041e 100644 --- a/chess/__init__.py +++ b/chess/__init__.py @@ -2802,10 +2802,9 @@ def parse_san(self, san: str) -> Move: """ # Castling. try: - san = san.replace('0', 'O') - if san in ["O-O", "O-O+", "O-O#"]: + if san in ["O-O", "O-O+", "O-O#", "0-0", "0-0+", "0-0#"]: return next(move for move in self.generate_castling_moves() if self.is_kingside_castling(move)) - elif san in ["O-O-O", "O-O-O+", "O-O-O#"]: + elif san in ["O-O-O", "O-O-O+", "O-O-O#", "0-0-0", "0-0-0+", "0-0-0#"]: return next(move for move in self.generate_castling_moves() if self.is_queenside_castling(move)) except StopIteration: raise ValueError(f"illegal san: {san!r} in {self.fen()}")