Skip to content

Commit

Permalink
Still need to catch TypeError
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
mnlevy1981 committed Mar 7, 2024
1 parent c15e634 commit c2f6188
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions MARBL_tools/MARBL_settings_file_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c2f6188

Please sign in to comment.