summaryrefslogtreecommitdiff
path: root/setup.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 /setup.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 'setup.py')
-rw-r--r--setup.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 215102b..e8780f3 100644
--- a/setup.py
+++ b/setup.py
@@ -144,9 +144,9 @@ class ve_build_ext(build_ext):
build_ext.build_extension(self, ext)
except ext_errors:
raise BuildFailed()
- except ValueError:
+ except ValueError as err:
# this can happen on Windows 64 bit, see Python issue 7511
- if "'path'" in str(sys.exc_info()[1]): # works with both py 2/3
+ if "'path'" in str(err): # works with both py 2/3
raise BuildFailed()
raise
@@ -186,9 +186,8 @@ def main():
# extension. Try it with, and if it fails, try it without.
try:
setup(**setup_args)
- except BuildFailed:
+ except BuildFailed as exc:
msg = "Couldn't install with extension module, trying without it..."
- exc = sys.exc_info()[1]
exc_msg = "%s: %s" % (exc.__class__.__name__, exc.cause)
print("**\n** %s\n** %s\n**" % (msg, exc_msg))