From debde38727d2da861f03286ea2ea8c343197ddec Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 22 Oct 2021 12:15:53 +0000 Subject: [PATCH] Refactor unnecessary `else` / `elif` when `if` block has a `raise` statement --- .../bot_files/lib/classes/games/tictactoe.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/minato_namikaze/bot_files/lib/classes/games/tictactoe.py b/minato_namikaze/bot_files/lib/classes/games/tictactoe.py index 8615d355..e9d9ee77 100644 --- a/minato_namikaze/bot_files/lib/classes/games/tictactoe.py +++ b/minato_namikaze/bot_files/lib/classes/games/tictactoe.py @@ -66,15 +66,13 @@ async def MakeMove(self, emoji: str, user: discord.Member) -> list: if emoji not in self._controls: raise KeyError("Provided emoji is not one of the valid controls") - - else: - x, y = self._conversion[emoji] - piece = self._PlayerToEmoji[user] - self.board[x][y] = piece - self.turn = self.circle if user == self.cross else self.cross - self._conversion.pop(emoji) - self._controls.remove(emoji) - return self.board + x, y = self._conversion[emoji] + piece = self._PlayerToEmoji[user] + self.board[x][y] = piece + self.turn = self.circle if user == self.cross else self.cross + self._conversion.pop(emoji) + self._controls.remove(emoji) + return self.board async def GameOver(self) -> bool: