From fd5ba852dd177ef3fb8ebf35ae2f72c88d608674 Mon Sep 17 00:00:00 2001 From: Allber Fellype <133912146+JamesStewart314@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:03:00 -0300 Subject: [PATCH] =?UTF-8?q?Remo=C3=A7=C3=A3o=20de=20exce=C3=A7=C3=A3o=20ge?= =?UTF-8?q?n=C3=A9rica=20devido=20ao=20Pylint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desafio-11/JamesStewart-314/python/solution.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/desafio-11/JamesStewart-314/python/solution.py b/desafio-11/JamesStewart-314/python/solution.py index b4bb52c11..c4a8587f5 100644 --- a/desafio-11/JamesStewart-314/python/solution.py +++ b/desafio-11/JamesStewart-314/python/solution.py @@ -29,7 +29,7 @@ def print_biggest_seq(file_path: str, upper_limit: int = 10 ** 4) -> str: try: pi_digits: str = (t := open(file_path, "r").readline().rstrip())[t.index('.') + 1:] except FileNotFoundError as error: - raise Exception(f"Error: Could open file \'{file_path}\'.") from error + raise ValueError(f"Error: Could open file \'{file_path}\'.") from error except ValueError: pi_digits: str = t @@ -52,8 +52,8 @@ def print_biggest_seq(file_path: str, upper_limit: int = 10 ** 4) -> str: if __name__ == '__main__': - file_path: str = os.path.join(os.path.dirname(__file__), "pi-1M.txt") + pi_digits_file_path: str = os.path.join(os.path.dirname(__file__), "pi-1M.txt") try: - print_biggest_seq(file_path) - except Exception as error: - print(error) + print_biggest_seq(pi_digits_file_path) + except ValueError as valError: + print(valError)