diff options
author | David Lord <davidism@gmail.com> | 2021-10-06 06:46:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-06 06:46:29 -0700 |
commit | 2dbde87a97697758156e0ef92c507bf3d82ee7f0 (patch) | |
tree | 0a53f8f5a7e0b7086cce807f1a955479ccf63bb1 | |
parent | e270e49f1c2f18884ce1b77313cc85ebcd106c8c (diff) | |
parent | 98452bc8bb672d1c3e86ed1d7015dbd8883108cc (diff) | |
download | markupsafe-2dbde87a97697758156e0ef92c507bf3d82ee7f0.tar.gz |
Merge pull request #253 from pallets/except-chain
use exception chaining
-rw-r--r-- | setup.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -22,18 +22,18 @@ class ve_build_ext(build_ext): def run(self): try: build_ext.run(self) - except DistutilsPlatformError: - raise BuildFailed() + except DistutilsPlatformError as e: + raise BuildFailed() from e def build_extension(self, ext): try: build_ext.build_extension(self, ext) - except (CCompilerError, DistutilsExecError, DistutilsPlatformError): - raise BuildFailed() - except ValueError: + except (CCompilerError, DistutilsExecError, DistutilsPlatformError) as e: + raise BuildFailed() from e + except ValueError as e: # this can happen on Windows 64 bit, see Python issue 7511 if "'path'" in str(sys.exc_info()[1]): # works with Python 2 and 3 - raise BuildFailed() + raise BuildFailed() from e raise |