Cause system exit only for non-zero exit statuses in setuptools command

See https://github.com/pypa/setuptools/issues/850#issuecomment-265445007
This commit is contained in:
Ville Skyttä 2016-12-08 14:51:06 +02:00
parent 348722d77b
commit 2bc78e62bc

View file

@ -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