Skip to content

Commit abbff8a

Browse files
committed
Update logic for removing env_postprocessing.xml
pytest was raising flags in Case.flush() [maybe because of the way make_valid_case() created a new case directory?]; I'm sure there's a far more pythonic way to write this logic, but I need to avoid os.path.isfile(None)
1 parent f9da5bb commit abbff8a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CIME/case/case.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,12 @@ def flush(self, flushall=False):
437437
# do not flush if caseroot wasnt created
438438
return
439439

440-
if not os.path.isfile(self.get_value("POSTPROCESSING_SPEC_FILE")):
440+
_postprocessing_spec_file = self.get_value("POSTPROCESSING_SPEC_FILE")
441+
if _postprocessing_spec_file is not None:
442+
have_postprocessing = os.path.isfile(_postprocessing_spec_file)
443+
else:
444+
have_postprocessing = False
445+
if not have_postprocessing:
441446
# Remove env_postprocessing.xml from self._files
442447
self._files = [
443448
file

0 commit comments

Comments
 (0)