Fixed running python examples --test for python3; needs to be tested under windows.

This commit is contained in:
Luke Campagnola 2013-11-16 21:51:55 -05:00
parent 8d7ab108fd
commit 1e82104986

View File

@ -252,6 +252,7 @@ except:
else: else:
process = subprocess.Popen(['exec %s -i' % (exe)], shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) process = subprocess.Popen(['exec %s -i' % (exe)], shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
process.stdin.write(code.encode('UTF-8')) process.stdin.write(code.encode('UTF-8'))
process.stdin.close() ##?
output = '' output = ''
fail = False fail = False
while True: while True:
@ -266,8 +267,8 @@ except:
break break
time.sleep(1) time.sleep(1)
process.kill() process.kill()
#process.wait() #res = process.communicate()
res = process.communicate() res = (process.stdout.read(), process.stderr.read())
if fail or 'exception' in res[1].decode().lower() or 'error' in res[1].decode().lower(): if fail or 'exception' in res[1].decode().lower() or 'error' in res[1].decode().lower():
print('.' * (50-len(name)) + 'FAILED') print('.' * (50-len(name)) + 'FAILED')