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 | 6dfbb755d1f6994ccec9ae56ad7f2eedad2ed0d6 (patch) | |
tree | 11be85589c7f72a5073ace06d563fafbf638b443 /setup.py | |
parent | 50959ccaaa07ccfb5a01cb38eb5d2b548e0dfe9a (diff) | |
download | python-coveragepy-git-6dfbb755d1f6994ccec9ae56ad7f2eedad2ed0d6.tar.gz |
Except clause can now use 'as', no need for lots of sys.exc_info
--HG--
branch : 4.0
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)) |