diff options
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -2,6 +2,7 @@ import os import sys from distutils import log +from io import StringIO from setuptools import find_packages, setup @@ -63,6 +64,20 @@ extras_require = { cmdclass = {} + +class Tee(object): + def __init__(self, stream): + self.stream = stream + self.buffer = StringIO() + + def write(self, s): + self.stream.write(s) + self.buffer.write(s) + + def flush(self): + self.stream.flush() + + try: from babel.messages.pofile import read_po from babel.messages.frontend import compile_catalog @@ -80,7 +95,13 @@ else: """ def run(self): - compile_catalog.run(self) + try: + sys.stderr = Tee(sys.stderr) + compile_catalog.run(self) + finally: + if sys.stderr.buffer.getvalue(): + print("Compiling failed.") + sys.exit(1) if isinstance(self.domain, list): for domain in self.domain: @@ -155,7 +176,7 @@ setup( name='Sphinx', version=sphinx.__version__, url='http://sphinx-doc.org/', - download_url='https://pypi.python.org/pypi/Sphinx', + download_url='https://pypi.org/project/Sphinx/', license='BSD', author='Georg Brandl', author_email='georg@python.org', |