summaryrefslogtreecommitdiff
path: root/Lib/test/test_future.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-01-10 16:19:56 +0000
committerGuido van Rossum <guido@python.org>2007-01-10 16:19:56 +0000
commitb940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch)
tree0b9ea19eba1e665dac95126c3140ac2bc36326ad /Lib/test/test_future.py
parent893523e80a2003d4a630aafb84ba016e0070cbbd (diff)
downloadcpython-git-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.gz
SF patch 1631942 by Collin Winter:
(a) "except E, V" -> "except E as V" (b) V is now limited to a simple name (local variable) (c) V is now deleted at the end of the except block
Diffstat (limited to 'Lib/test/test_future.py')
-rw-r--r--Lib/test/test_future.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py
index 9a5f8298cc..1437489d90 100644
--- a/Lib/test/test_future.py
+++ b/Lib/test/test_future.py
@@ -29,7 +29,7 @@ class FutureTest(unittest.TestCase):
def test_badfuture3(self):
try:
from test import badsyntax_future3
- except SyntaxError, msg:
+ except SyntaxError as msg:
self.assertEqual(get_error_location(msg), ("badsyntax_future3", '3'))
else:
self.fail("expected exception didn't occur")
@@ -37,7 +37,7 @@ class FutureTest(unittest.TestCase):
def test_badfuture4(self):
try:
from test import badsyntax_future4
- except SyntaxError, msg:
+ except SyntaxError as msg:
self.assertEqual(get_error_location(msg), ("badsyntax_future4", '3'))
else:
self.fail("expected exception didn't occur")
@@ -45,7 +45,7 @@ class FutureTest(unittest.TestCase):
def test_badfuture5(self):
try:
from test import badsyntax_future5
- except SyntaxError, msg:
+ except SyntaxError as msg:
self.assertEqual(get_error_location(msg), ("badsyntax_future5", '4'))
else:
self.fail("expected exception didn't occur")
@@ -53,7 +53,7 @@ class FutureTest(unittest.TestCase):
def test_badfuture6(self):
try:
from test import badsyntax_future6
- except SyntaxError, msg:
+ except SyntaxError as msg:
self.assertEqual(get_error_location(msg), ("badsyntax_future6", '3'))
else:
self.fail("expected exception didn't occur")
@@ -61,7 +61,7 @@ class FutureTest(unittest.TestCase):
def test_badfuture7(self):
try:
from test import badsyntax_future7
- except SyntaxError, msg:
+ except SyntaxError as msg:
self.assertEqual(get_error_location(msg), ("badsyntax_future7", '3'))
else:
self.fail("expected exception didn't occur")
@@ -69,7 +69,7 @@ class FutureTest(unittest.TestCase):
def test_badfuture8(self):
try:
from test import badsyntax_future8
- except SyntaxError, msg:
+ except SyntaxError as msg:
self.assertEqual(get_error_location(msg), ("badsyntax_future8", '3'))
else:
self.fail("expected exception didn't occur")
@@ -77,7 +77,7 @@ class FutureTest(unittest.TestCase):
def test_badfuture9(self):
try:
from test import badsyntax_future9
- except SyntaxError, msg:
+ except SyntaxError as msg:
self.assertEqual(get_error_location(msg), ("badsyntax_future9", '3'))
else:
self.fail("expected exception didn't occur")