From 80827109ec62fc46b82e7e228cb469c557b61a32 Mon Sep 17 00:00:00 2001 From: Pedro Bressan Date: Thu, 5 Sep 2024 16:17:26 -0300 Subject: [PATCH] MNT: fix pylint messages on file handling. --- rocketpy/simulation/monte_carlo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rocketpy/simulation/monte_carlo.py b/rocketpy/simulation/monte_carlo.py index bb94643be..e61347b6a 100644 --- a/rocketpy/simulation/monte_carlo.py +++ b/rocketpy/simulation/monte_carlo.py @@ -224,7 +224,8 @@ def __setup_files(self, append): idx_i = len(input_file.readlines()) with open(self._output_file, open_mode, encoding="utf-8") as output_file: idx_o = len(output_file.readlines()) - open(self._error_file, open_mode, encoding="utf-8").close() + with open(self._error_file, open_mode, encoding="utf-8"): + pass if idx_i != idx_o and not append: warnings.warn(