Skip to content

Commit

Permalink
Merge pull request #254 from The-4th-Hokage/deepsource-fix-577b0ccf
Browse files Browse the repository at this point in the history
Refactor unnecessary `else` / `elif` when `if` block has a `raise` statement
  • Loading branch information
Dhruvacube authored Oct 22, 2021
2 parents 30a8112 + debde38 commit f752514
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions minato_namikaze/bot_files/lib/classes/games/tictactoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit f752514

Please sign in to comment.