summaryrefslogtreecommitdiff
path: root/sphinx/util/parallel.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/parallel.py')
-rw-r--r--sphinx/util/parallel.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/sphinx/util/parallel.py b/sphinx/util/parallel.py
index 066e3c93a..d847fa163 100644
--- a/sphinx/util/parallel.py
+++ b/sphinx/util/parallel.py
@@ -15,8 +15,6 @@ import time
import traceback
from math import sqrt
-from six import iteritems
-
try:
import multiprocessing
except ImportError:
@@ -36,7 +34,7 @@ logger = logging.getLogger(__name__)
parallel_available = multiprocessing and (os.name == 'posix')
-class SerialTasks(object):
+class SerialTasks:
"""Has the same interface as ParallelTasks, but executes tasks directly."""
def __init__(self, nproc=1):
@@ -57,7 +55,7 @@ class SerialTasks(object):
pass
-class ParallelTasks(object):
+class ParallelTasks:
"""Executes *nproc* tasks in parallel after forking."""
def __init__(self, nproc):
@@ -115,7 +113,7 @@ class ParallelTasks(object):
def _join_one(self):
# type: () -> None
- for tid, pipe in iteritems(self._precvs):
+ for tid, pipe in self._precvs.items():
if pipe.poll():
exc, logs, result = pipe.recv()
if exc:
@@ -137,7 +135,7 @@ class ParallelTasks(object):
def make_chunks(arguments, nproc, maxbatch=10):
- # type: (Sequence[unicode], int, int) -> List[Any]
+ # type: (Sequence[str], int, int) -> List[Any]
# determine how many documents to read in one go
nargs = len(arguments)
chunksize = nargs // nproc