Skip to content

Commit

Permalink
Fix mypy erros in realization_state.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Nov 28, 2023
1 parent c784970 commit 3ee9713
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/ert/job_queue/realization_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,19 @@ def on_enter_EXIT(self) -> None:
)
if exit_file_path.exists():
exit_file = etree.parse(exit_file_path)
failed_job = exit_file.find("job").text
error_reason = exit_file.find("reason").text
stderr_capture = exit_file.find("stderr").text
failed_job: Optional[str] = None
if job_elem := exit_file.find("job"):
failed_job = job_elem.text

stderr_file = ""
error_reason: Optional[str] = None
if reason_elem := exit_file.find("reason"):
error_reason = reason_elem.text

stderr_capture: Optional[str] = None
if stderr_elem := exit_file.find("stderr"):
stderr_capture = stderr_elem.text

stderr_file: Optional[str] = None
if stderr_file_node := exit_file.find("stderr_file"):
stderr_file = stderr_file_node.text

Expand Down

0 comments on commit 3ee9713

Please sign in to comment.