Skip to content

Commit

Permalink
Merge pull request NCAR#5 from climbfuji/update_gsd_develop_from_mast…
Browse files Browse the repository at this point in the history
…er_20200616

Update gsd/develop from master 2020/06/16
  • Loading branch information
DomHeinzeller authored Jun 19, 2020
2 parents e883bb0 + ee3b2ab commit 9578bf9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,19 @@ def execute(cmd, abort = True):
status = p.returncode
if debug:
message = 'Execution of "{0}" returned with exit code {1}\n'.format(cmd, status)
message += ' stdout: "{0}"\n'.format(stdout.decode('ascii').rstrip('\n'))
message += ' stderr: "{0}"'.format(stderr.decode('ascii').rstrip('\n'))
message += ' stdout: "{0}"\n'.format(stdout.decode(encoding='ascii', errors='ignore').rstrip('\n'))
message += ' stderr: "{0}"'.format(stderr.decode(encoding='ascii', errors='ignore').rstrip('\n'))
logging.debug(message)
if not status == 0:
message = 'Execution of command {0} failed, exit code {1}\n'.format(cmd, status)
message += ' stdout: "{0}"\n'.format(stdout.decode('ascii').rstrip('\n'))
message += ' stderr: "{0}"'.format(stderr.decode('ascii').rstrip('\n'))
message += ' stdout: "{0}"\n'.format(stdout.decode(encoding='ascii', errors='ignore').rstrip('\n'))
message += ' stderr: "{0}"'.format(stderr.decode(encoding='ascii', errors='ignore').rstrip('\n'))
if abort:
raise Exception(message)
else:
logging.error(message)
return (status, stdout.decode('ascii').rstrip('\n'), stderr.decode('ascii').rstrip('\n'))
return (status, stdout.decode(encoding='ascii', errors='ignore').rstrip('\n'),
stderr.decode(encoding='ascii', errors='ignore').rstrip('\n'))

def split_var_name_and_array_reference(var_name):
"""Split an expression like foo(:,a,1:ddt%ngas)
Expand Down

0 comments on commit 9578bf9

Please sign in to comment.