From af33fb16f7f602158a6d277a27037575c5c83eda Mon Sep 17 00:00:00 2001 From: hpk Date: Tue, 9 Sep 2008 23:36:30 +0200 Subject: [PATCH] [svn r58026] avoiding an issue with older pexpect versions --HG-- branch : trunk --- py/test/testing/acceptance_test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/py/test/testing/acceptance_test.py b/py/test/testing/acceptance_test.py index b3e1a5dce..bd6131817 100644 --- a/py/test/testing/acceptance_test.py +++ b/py/test/testing/acceptance_test.py @@ -389,8 +389,12 @@ class TestInteractive(AcceptBase): def getspawn(self): try: import pexpect - except ImportError: - py.test.skip("need pexpect") + ver = tuple(map(int, pexpect.__version__.split("."))) + if ver < (2,3): # because sendeof() fails on sys.stdin.fileno() otherwise + # because we are running captured + raise AttributeError + except (ImportError, AttributeError): + py.test.skip("need pexpect version >= 2.3") def spawn(cmd): return pexpect.spawn(cmd, logfile=self.tmpdir.join("spawn.out").open("w")) return spawn