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 /setup.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 'setup.py')
-rw-r--r-- | setup.py | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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)) |