Skip to content

Commit

Permalink
Prevent infinite recursion in Case.
Browse files Browse the repository at this point in the history
This commit prevents `Case.get_resolved_value` from getting stuck in an
infinitely recursive loop.

Passes `scripts_regression_tests` (except for some pre-existing broken
tests due to `pylint` issues).
  • Loading branch information
quantheory committed Aug 19, 2016
1 parent a5e7531 commit aa6a8a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/python/CIME/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ def get_resolved_value(self, item, recurse=0):
else:
item = self.get_resolved_value(item,recurse=recurse+1)

if(recurse >= recurse_limit):
if recurse >= 2*recurse_limit:
logging.warning("Not able to fully resolve item '%s'" % item)
elif recurse >= recurse_limit:
#try env_batch first
env_batch = self.get_env("batch")
item = env_batch.get_resolved_value(item)
Expand Down

0 comments on commit aa6a8a1

Please sign in to comment.