From c2f6188af9e112cc5488716538824bc9ec8e5c9d Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Thu, 7 Mar 2024 12:50:57 -0700 Subject: [PATCH] Still need to catch TypeError I removed an except TypeError block from MARBL_settings_file_class, but we still need that to capture times when input_file is None. At some point, I think the whole try-except block can be replaced with a couple of if statements (return if input_file is None, abort if input_file is not found) --- MARBL_tools/MARBL_settings_file_class.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MARBL_tools/MARBL_settings_file_class.py b/MARBL_tools/MARBL_settings_file_class.py index f6ebe027..269236d7 100644 --- a/MARBL_tools/MARBL_settings_file_class.py +++ b/MARBL_tools/MARBL_settings_file_class.py @@ -647,6 +647,9 @@ def _parse_input_file(input_file, exclude_dict): # Single value input_dict[var_name] = value f.close() + except TypeError: + # If inputfile == None then the open will result in TypeError + pass except FileNotFoundError: logger.error("input_file '%s' was not found" % input_file) MARBL_tools.abort(1)