Skip to content

Commit

Permalink
Fix subtypes of ConfigWarning not being caught
Browse files Browse the repository at this point in the history
This commit fixes the issue where subtypes of `ConfigWarning` would not be reported in the `gui/main.py::_start_inititial_gui_window(...)` function.
  • Loading branch information
jonathan-eq committed Oct 2, 2024
1 parent 61c648a commit 71bb3ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ert/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ def _start_initial_gui_window(
config_warnings = [
cast(ConfigWarning, w.message).info
for w in all_warnings
if w.category == ConfigWarning
if issubclass(w.category, ConfigWarning)
and not cast(ConfigWarning, w.message).info.is_deprecation
]
deprecations = [
cast(ConfigWarning, w.message).info
for w in all_warnings
if w.category == ConfigWarning
if issubclass(w.category, ConfigWarning)
and cast(ConfigWarning, w.message).info.is_deprecation
]
error_messages += error.errors
Expand Down Expand Up @@ -146,13 +146,13 @@ def _start_initial_gui_window(
config_warnings = [
cast(ConfigWarning, w.message).info
for w in all_warnings
if w.category == ConfigWarning
if issubclass(w.category, ConfigWarning)
and not cast(ConfigWarning, w.message).info.is_deprecation
]
deprecations = [
cast(ConfigWarning, w.message).info
for w in all_warnings
if w.category == ConfigWarning
if issubclass(w.category, ConfigWarning)
and cast(ConfigWarning, w.message).info.is_deprecation
]
counter_fm_steps = Counter(fms.name for fms in ert_config.forward_model_steps)
Expand Down

0 comments on commit 71bb3ce

Please sign in to comment.