summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-01-08 01:38:45 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2017-01-08 01:38:45 +0900
commit4153ee0d9d33074b09c7ee8b241dc1d61eb3f32f (patch)
tree11aa1a35e24ef1b5fec5851a5798efa7eb54f716
parentf1d2a7ffaa1689e3e20c846b88969c2aadd284be (diff)
downloadsphinx-git-4153ee0d9d33074b09c7ee8b241dc1d61eb3f32f.tar.gz
Fix Sphinx crashes on parallel build with an extension which raises unserializable exception
-rw-r--r--CHANGES2
-rw-r--r--sphinx/errors.py7
-rw-r--r--sphinx/util/parallel.py3
3 files changed, 7 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index 3d2bc693e..beab1c718 100644
--- a/CHANGES
+++ b/CHANGES
@@ -27,6 +27,8 @@ Bugs fixed
* #3294: ``add_latex_package()`` make crashes non-LaTeX builders
* The caption of table are rendered as invalid HTML (refs: #3287)
* #3268: Sphinx crashes with requests package from Debian jessie
+* #3284: Sphinx crashes on parallel build with an extension which raises
+ unserializable exception
Release 1.5.1 (released Dec 13, 2016)
diff --git a/sphinx/errors.py b/sphinx/errors.py
index 5fb77a135..01f92a3cf 100644
--- a/sphinx/errors.py
+++ b/sphinx/errors.py
@@ -71,10 +71,9 @@ class SphinxParallelError(SphinxError):
category = 'Sphinx parallel build error'
- def __init__(self, orig_exc, traceback):
- self.orig_exc = orig_exc
+ def __init__(self, message, traceback):
+ self.message = message
self.traceback = traceback
def __str__(self):
- return traceback.format_exception_only(
- self.orig_exc.__class__, self.orig_exc)[0].strip()
+ return self.message
diff --git a/sphinx/util/parallel.py b/sphinx/util/parallel.py
index bace0b5fd..4f4cd5c46 100644
--- a/sphinx/util/parallel.py
+++ b/sphinx/util/parallel.py
@@ -73,7 +73,8 @@ class ParallelTasks(object):
ret = func(arg)
pipe.send((False, ret))
except BaseException as err:
- pipe.send((True, (err, traceback.format_exc())))
+ errmsg = traceback.format_exception_only(err.__class__, err)[0].strip()
+ pipe.send((True, (errmsg, traceback.format_exc())))
def add_task(self, task_func, arg=None, result_func=None):
tid = self._taskid