diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-20 08:23:52 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-20 08:23:52 -0400 |
commit | be9682a29632257842384b0cecca6b9b6475216c (patch) | |
tree | 9db56d528a7d03a33165f5ad454321ed790973e0 /tests/backunittest.py | |
parent | 120d89c2732bf43ab284f02c63a50ef89d9e4fd0 (diff) | |
download | python-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.py | 5 |
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. |