Skip to content

Commit

Permalink
do not eval words - only strings with whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed May 26, 2017
1 parent 162ba85 commit cf843f9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/lib/CIME/XML/env_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,13 @@ def get_submit_args(self, case, job):
val = case.get_resolved_value(name)

if val is not None and len(str(val)) > 0 and val != "None":
# Try to evaluate val
try:
rval = eval(val)
except:
# Try to evaluate val if it contains any whitespace
if " " in val:
try:
rval = eval(val)
except:
rval = val
else:
rval = val
# need a correction for tasks per node
if flag == "-n" and rval<= 0:
Expand Down

0 comments on commit cf843f9

Please sign in to comment.