fixed errno handling for MacOS

This commit is contained in:
Andrew Tridgell 2011-12-22 16:57:03 -08:00
parent 66029af574
commit 3f2d1764b6
1 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
# run a jsbsim model as a child process
import sys, os, pexpect, fdpexpect, socket
import math, time, select, struct, signal
import math, time, select, struct, signal, errno
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'pysim'))
@ -87,7 +87,7 @@ def process_jsb_input(buf):
fdm.set('rpm', sitl_state.throttle*1000)
fg_out.send(fdm.pack())
except socket.error as e:
if e.errno not in [ 111 ]:
if e.errno not in [ errno.ECONNREFUSED ]:
raise
simbuf = struct.pack('<16dI',
@ -111,7 +111,7 @@ def process_jsb_input(buf):
try:
sim_out.send(simbuf)
except socket.error as e:
if e.errno not in [ 111 ]:
if e.errno not in [ errno.ECONNREFUSED ]:
raise