diff --git a/pyiron_base/jobs/job/generic.py b/pyiron_base/jobs/job/generic.py index 4bf6f2d7c..721f74478 100644 --- a/pyiron_base/jobs/job/generic.py +++ b/pyiron_base/jobs/job/generic.py @@ -166,7 +166,7 @@ def __init__(self, project, job_name): self._python_only_job = False self._write_work_dir_warnings = True self.interactive_cache = None - self.error = GenericError(job=self) + self.error = GenericError(working_directory=self.project_hdf5.working_directory) @property def version(self): @@ -1566,8 +1566,8 @@ def _get_executor(self, max_workers=None): class GenericError(object): - def __init__(self, job): - self._job = job + def __init__(self, working_directory): + self._working_directory = working_directory def __repr__(self): all_messages = "" @@ -1585,7 +1585,8 @@ def print_queue(self, string=""): return self._print_error(file_name="error.out", string=string) def _print_error(self, file_name, string="", print_yes=True): - if self._job[file_name] is None: + if not os.path.exists(os.path.join(self._working_directory, file_name)): return "" elif print_yes: - return string.join(self._job[file_name]) + with open(os.path.join(self._working_directory, file_name)) as f: + return string.join(f.readlines())