diff options
| author | Ville Skyttä <ville.skytta@iki.fi> | 2016-12-08 14:51:06 +0200 |
|---|---|---|
| committer | Ville Skyttä <ville.skytta@iki.fi> | 2016-12-08 18:13:03 +0200 |
| commit | 2bc78e62bc036db65135e37a9bc9d7c6d6496ebe (patch) | |
| tree | 48ea417a5653deaea328b80fd720b9ce5742d191 | |
| parent | 348722d77b32ad2ecc064559bb8b4cae08e85549 (diff) | |
| download | flake8-2bc78e62bc036db65135e37a9bc9d7c6d6496ebe.tar.gz | |
Cause system exit only for non-zero exit statuses in setuptools command
See https://github.com/pypa/setuptools/issues/850#issuecomment-265445007
| -rw-r--r-- | src/flake8/main/setuptools_command.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/flake8/main/setuptools_command.py b/src/flake8/main/setuptools_command.py index f6bd7a8..ba5a260 100644 --- a/src/flake8/main/setuptools_command.py +++ b/src/flake8/main/setuptools_command.py @@ -94,4 +94,10 @@ class Flake8(setuptools.Command): self.flake8.report_statistics() self.flake8.report_benchmarks() self.flake8.formatter.stop() - self.flake8.exit() + try: + self.flake8.exit() + except SystemExit as e: + # Cause system exit only if exit code is not zero (terminates + # other possibly remaining/pending setuptools commands). + if e.code: + raise |
