abandon startup if cpu module does not start

This commit is contained in:
Greg Hewgill 2011-08-19 21:07:19 +12:00
parent 15e174c02a
commit 9f09818aa0
1 changed files with 5 additions and 0 deletions

View File

@ -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):