summaryrefslogtreecommitdiff
path: root/tests/test_timeout_pattern.py
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2013-09-17 15:52:47 -0700
committerThomas Kluyver <takowl@gmail.com>2013-09-17 15:52:47 -0700
commit5cdccd73558298331d580792f48986b24b8bc3c9 (patch)
treeea18f463327a5376777c015c392bd66c4ef0141f /tests/test_timeout_pattern.py
parent98012748c31623b0c99103ebb79d111ee0c8317c (diff)
downloadpexpect-git-5cdccd73558298331d580792f48986b24b8bc3c9.tar.gz
Use new style except statements in tests
Diffstat (limited to 'tests/test_timeout_pattern.py')
-rwxr-xr-xtests/test_timeout_pattern.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_timeout_pattern.py b/tests/test_timeout_pattern.py
index 606b045..e617502 100755
--- a/tests/test_timeout_pattern.py
+++ b/tests/test_timeout_pattern.py
@@ -43,7 +43,7 @@ class Exp_TimeoutTestCase(PexpectTestCase.PexpectTestCase):
p.sendline('Hello')
p.expect('Hello')
p.expect('Goodbye',timeout=5)
- except pexpect.TIMEOUT, expTimeoutInst:
+ except pexpect.TIMEOUT as expTimeoutInst:
assert p.match_index == None
else:
self.fail("Did not generate a TIMEOUT exception.")
@@ -63,7 +63,7 @@ class Exp_TimeoutTestCase(PexpectTestCase.PexpectTestCase):
p = pexpect.spawn('cat')
p.sendline('Hello')
p.expect('Goodbye',timeout=5)
- except pexpect.TIMEOUT, e:
+ except pexpect.TIMEOUT as e:
if e.get_trace().count("pexpect.py") != 0:
self.fail("The TIMEOUT get_trace() referenced pexpect.py. It should only reference the caller.\n"+e.get_trace())
@@ -76,7 +76,7 @@ class Exp_TimeoutTestCase(PexpectTestCase.PexpectTestCase):
p = pexpect.spawn('cat')
p.sendline('Hello')
nestedFunction(p)
- except pexpect.TIMEOUT, e:
+ except pexpect.TIMEOUT as e:
if e.get_trace().count("nestedFunction") == 0:
self.fail("The TIMEOUT get_trace() did not show the call to the nestedFunction function.\n" + str(e) + "\n" + e.get_trace())