From 3f2d1764b664ae20906a6ab172b50f462382e69e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 Dec 2011 16:57:03 -0800 Subject: [PATCH] fixed errno handling for MacOS --- Tools/autotest/jsbsim/runsim.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tools/autotest/jsbsim/runsim.py b/Tools/autotest/jsbsim/runsim.py index 6a442a3699..528a811bf5 100755 --- a/Tools/autotest/jsbsim/runsim.py +++ b/Tools/autotest/jsbsim/runsim.py @@ -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