From 9f09818aa03362431add8770593236892cd02a65 Mon Sep 17 00:00:00 2001 From: Greg Hewgill Date: Fri, 19 Aug 2011 21:07:19 +1200 Subject: [PATCH] abandon startup if cpu module does not start --- applepy.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/applepy.py b/applepy.py index cebe0c0..2c35ca5 100644 --- a/applepy.py +++ b/applepy.py @@ -5,6 +5,7 @@ import numpy import pygame +import select import socket import struct import subprocess @@ -374,6 +375,10 @@ class Apple2: ]) self.core = subprocess.Popen(args) + rs, _, _ = select.select([listener], [], [], 2) + if not rs: + print >>sys.stderr, "CPU module did not start" + sys.exit(1) self.cpu, _ = listener.accept() def run(self):