summaryrefslogtreecommitdiff
path: root/tests/test_misc.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_misc.py
parent98012748c31623b0c99103ebb79d111ee0c8317c (diff)
downloadpexpect-5cdccd73558298331d580792f48986b24b8bc3c9.tar.gz
Use new style except statements in tests
Diffstat (limited to 'tests/test_misc.py')
-rwxr-xr-xtests/test_misc.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_misc.py b/tests/test_misc.py
index d073dcc..298a034 100755
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -129,7 +129,7 @@ class TestCaseMisc(PexpectTestCase.PexpectTestCase):
child.terminated = 0 # Force invalid state to test code
try:
child.isalive()
- except pexpect.ExceptionPexpect, e:
+ except pexpect.ExceptionPexpect as e:
pass
else:
self.fail ("child.isalive() should have raised a pexpect.ExceptionPexpect")
@@ -138,13 +138,13 @@ class TestCaseMisc(PexpectTestCase.PexpectTestCase):
'''This tests that we get a graceful error when passing bad arguments.'''
try:
p = pexpect.spawn(1)
- except pexpect.ExceptionPexpect, e:
+ except pexpect.ExceptionPexpect as e:
pass
else:
self.fail ("pexpect.spawn(1) should have raised a pexpect.ExceptionPexpect.")
try:
p = pexpect.spawn('ls', '-la') # should really use pexpect.spawn('ls', ['-ls'])
- except TypeError, e:
+ except TypeError as e:
pass
else:
self.fail ("pexpect.spawn('ls', '-la') should have raised a TypeError.")
@@ -152,7 +152,7 @@ class TestCaseMisc(PexpectTestCase.PexpectTestCase):
p = pexpect.spawn('cat')
p.close()
p.read_nonblocking(size=1, timeout=3)
- except ValueError, e:
+ except ValueError as e:
pass
else:
self.fail ("read_nonblocking on closed spawn object should have raised a ValueError.")
@@ -166,7 +166,7 @@ class TestCaseMisc(PexpectTestCase.PexpectTestCase):
child = pexpect.spawn('cat')
try:
child.expect({}) # We don't support dicts yet. Should give TypeError
- except TypeError, e:
+ except TypeError as e:
pass
else:
self.fail ("child.expect({}) should have raised a TypeError")