Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 23e708727..d73f1d270 100644
--- a/setup.py
+++ b/setup.py
@@ -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: