Mercurial > lcfOS
changeset 371:9c95f93f5b7a
Python 3.2 compatible issues
author | Windel Bouwman |
---|---|
date | Fri, 21 Mar 2014 12:01:19 +0100 |
parents | f86e79246602 |
children | 68841f9ab96c |
files | test/testemulation.py |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/test/testemulation.py Fri Mar 21 11:57:32 2014 +0100 +++ b/test/testemulation.py Fri Mar 21 12:01:19 2014 +0100 @@ -59,9 +59,13 @@ # Send quit command: qemu_control.send("quit\n".encode('ascii')) - try: - p.wait(timeout=3) - except subprocess.TimeoutExpired: + if hasattr(subprocess, 'TimeoutExpired'): + try: + p.wait(timeout=3) + except subprocess.TimeoutExpired: + p.kill() + else: + time.sleep(2) p.kill() qemu_control.close() qemu_serial.close()