resolve issue \#1172: don't divide by zero

This commit is contained in:
garen 2013-06-10 21:28:48 -04:00
parent 83b061f7d5
commit f139a7d282
2 changed files with 4 additions and 2 deletions

View File

@ -15,8 +15,8 @@
import sys import sys
from os import path from os import path
__version__ = '1.2b1' __version__ = '1.2b1-xgen1-'
__released__ = '1.2b1' # used when Sphinx builds its own docs __released__ = '1.2b1-xgen1-' # used when Sphinx builds its own docs
package_dir = path.abspath(path.dirname(__file__)) package_dir = path.abspath(path.dirname(__file__))

View File

@ -354,6 +354,8 @@ class Builder(object):
# for the rest, determine how many documents to write in one go # for the rest, determine how many documents to write in one go
ndocs = len(docnames) ndocs = len(docnames)
chunksize = min(ndocs // nproc, 10) chunksize = min(ndocs // nproc, 10)
if chunksize == 0:
chunksize = 1
nchunks, rest = divmod(ndocs, chunksize) nchunks, rest = divmod(ndocs, chunksize)
if rest: if rest:
nchunks += 1 nchunks += 1