File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1145,15 +1145,15 @@ def simulate(
11451145 cmd_definition = om_cmd .definition ()
11461146 returncode = self ._session .run_model_executable (cmd_run_data = cmd_definition )
11471147 # and check returncode *AND* resultfile
1148- if returncode != 0 and self . _result_file . is_file () :
1148+ if returncode != 0 :
11491149 # check for an empty (=> 0B) result file which indicates a crash of the model executable
11501150 # see: https://github.com/OpenModelica/OMPython/issues/261
11511151 # https://github.com/OpenModelica/OpenModelica/issues/13829
1152- if self ._result_file .size () == 0 :
1152+ if self ._result_file .is_file () and self . _result_file . size () == 0 :
11531153 self ._result_file .unlink ()
11541154 raise ModelicaSystemError ("Empty result file - this indicates a crash of the model executable!" )
11551155
1156- logger .warning (f"Return code = { returncode } but result file exists !" )
1156+ logger .warning (f"Return code = { returncode } but result file was created !" )
11571157
11581158 self ._simulated = True
11591159
You can’t perform that action at this time.
0 commit comments