summaryrefslogtreecommitdiff
path: root/tests/backunittest.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2013-10-20 08:23:52 -0400
committerNed Batchelder <ned@nedbatchelder.com>2013-10-20 08:23:52 -0400
commitbe9682a29632257842384b0cecca6b9b6475216c (patch)
tree9db56d528a7d03a33165f5ad454321ed790973e0 /tests/backunittest.py
parent120d89c2732bf43ab284f02c63a50ef89d9e4fd0 (diff)
downloadpython-coveragepy-be9682a29632257842384b0cecca6b9b6475216c.tar.gz
Except clause can now use 'as', no need for lots of sys.exc_info
Diffstat (limited to 'tests/backunittest.py')
-rw-r--r--tests/backunittest.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/backunittest.py b/tests/backunittest.py
index 019e811..1641401 100644
--- a/tests/backunittest.py
+++ b/tests/backunittest.py
@@ -1,6 +1,6 @@
"""Implementations of unittest features from the future."""
-import difflib, re, sys, unittest
+import difflib, re, unittest
def _need(method):
@@ -55,8 +55,7 @@ class TestCase(unittest.TestCase):
"""
try:
callobj(*args, **kw)
- except excClass:
- _, exc, _ = sys.exc_info()
+ except excClass as exc:
excMsg = str(exc)
if re.search(regexp, excMsg):
# Message provided, and we got the right one: it passes.