Skip to content

Commit

Permalink
Also capture stderr in calls to rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
bstrie committed Feb 12, 2012
1 parent 90d54f7 commit 5d484d7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions build/rustic
Expand Up @@ -60,7 +60,8 @@ def put_gist(output, comp_ver):
res = json.loads(res.read().decode('u8'))
print('Scratch file pasted to ' + res['html_url'] + '\n')

comp_ver = subprocess.check_output(('rustc', '-v')).decode('u8')
comp_ver = subprocess.check_output(('rustc', '-v'), \
stderr=subprocess.STDOUT).decode('u8')
print('[Compiler info]\n' + comp_ver + '''
[Tips]
Blank line to eval, ^D or %clear to clear environment, ?expr to log expr,
Expand Down Expand Up @@ -115,11 +116,13 @@ try:
f.write(valid_head + new_head + \
valid_body + new_body + transient + '}')
try: # To compile the file
comp_msg = subprocess.check_output(('rustc', file_name)).decode('u8')
comp_msg = subprocess.check_output(('rustc', file_name),
stderr=subprocess.STDOUT).decode('u8')
if show_comp_msg and comp_msg != '':
print('[Compiler message]\n' + comp_msg)
try: # To run the file
output = subprocess.check_output(('./' + exe_name)).decode('u8')
output = subprocess.check_output(('./' + exe_name),
stderr=subprocess.STDOUT).decode('u8')
if output != '': print('[Output]\n' + output)
valid_head += new_head
valid_body += new_body
Expand Down

0 comments on commit 5d484d7

Please sign in to comment.