Commit 45d58286 authored by John Tourtellott's avatar John Tourtellott
Browse files

Check that sys.stdout exists in python env

It is None in current modelbuilder package (only tested windows)
parent da77cbc3
......@@ -266,7 +266,10 @@ def ExportCMB(export_op):
scope.files_to_upload.add(output_path)
print('Export completion status: %s' % completed)
sys.stdout.flush()
# In some runtime environments, stdout is null
if sys.stdout is not None:
sys.stdout.flush()
if not completed:
return completed
......
......@@ -275,7 +275,7 @@ class CumulusClient():
time.sleep(2)
# Provide some feedback at startup
if log_offset == 0:
if log_offset == 0 and sys.stdout is not None:
sys.stdout.write('.')
#print 'Checking status'
......@@ -307,7 +307,8 @@ class CumulusClient():
for l in output:
print(l)
sys.stdout.flush()
if sys.stdout is not None:
sys.stdout.flush()
if time.time() - start > job_timeout:
raise Exception('Job timeout')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment