Commit 3ae62a37 authored by Arun Babu Neelicattu's avatar Arun Babu Neelicattu
Browse files

executor: fix compatibility issue w/ py2 on windows

Python 2 running on Windows, causes thread leaks which
leads console io write errors when using pastel. This
works around the issue by limiting to a single worker
in these environments.
parent 427fc4aa
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ from subprocess import CalledProcessError
from poetry.core.packages.file_dependency import FileDependency
from poetry.core.packages.utils.link import Link
from poetry.io.null_io import NullIO
from poetry.utils._compat import PY2
from poetry.utils._compat import WINDOWS
from poetry.utils._compat import OrderedDict
from poetry.utils._compat import Path
from poetry.utils._compat import cpu_count
@@ -39,7 +41,7 @@ class Executor(object):
        self._chef = Chef(config, self._env)
        self._chooser = Chooser(pool, self._env)

        if parallel:
        if parallel and not (PY2 and WINDOWS):
            # This should be directly handled by ThreadPoolExecutor
            # however, on some systems the number of CPUs cannot be determined
            # (it raises a NotImplementedError), so, in this case, we assume