summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sphinx/builders/__init__.py4
-rw-r--r--sphinx/util/parallel.py8
2 files changed, 9 insertions, 3 deletions
diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py
index 5370dd70..bbb9b311 100644
--- a/sphinx/builders/__init__.py
+++ b/sphinx/builders/__init__.py
@@ -357,9 +357,11 @@ class Builder(object):
def _write_parallel(self, docnames, warnings, nproc):
def write_process(docs):
+ local_warnings = []
+ self.env.set_warnfunc(lambda *args: local_warnings.append(args))
for docname, doctree in docs:
self.write_doc(docname, doctree)
- return warnings
+ return local_warnings
def add_warnings(docs, wlist):
warnings.extend(wlist)
diff --git a/sphinx/util/parallel.py b/sphinx/util/parallel.py
index 5f9e8eff..7e238ab1 100644
--- a/sphinx/util/parallel.py
+++ b/sphinx/util/parallel.py
@@ -101,7 +101,9 @@ class ParallelTasks(object):
del self._threads[tid]
if exc:
raise SphinxParallelError(*result)
- self._result_funcs.pop(tid)(arg, result)
+ result_func = self._result_funcs.pop(tid)(arg, result)
+ if result_func:
+ result_func(result)
self._nprocessed += 1
def join(self):
@@ -110,7 +112,9 @@ class ParallelTasks(object):
del self._threads[tid]
if exc:
raise SphinxParallelError(*result)
- self._result_funcs.pop(tid)(arg, result)
+ result_func = self._result_funcs.pop(tid)(arg, result)
+ if result_func:
+ result_func(result)
self._nprocessed += 1
# there shouldn't be any threads left...