From d660da3b7f5c1ac9f3623976d2417836da5f93d7 Mon Sep 17 00:00:00 2001 From: Charles Antoine NOURY Date: Tue, 22 Nov 2022 16:52:17 +0100 Subject: [PATCH] [rules] added a try except --- src/rules.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rules.py b/src/rules.py index f53a32e..05e20d7 100644 --- a/src/rules.py +++ b/src/rules.py @@ -12,12 +12,12 @@ class Rules: Output: correct -> Bool: if True, the board size is correct """ - correct = True + correct = False - if not self.nb_col == board.nb_col: - correct = False - - if not self.nb_row == board.nb_row: - correct = False + try: + if self.nb_col == board.nb_col and self.nb_row == board.nb_row : + correct = True + except Exception: + print("Exception: check_board_size: col and row parameters might are compared to another type") return correct