Commit 3ae62a37 by Arun Babu Neelicattu

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
...@@ -12,6 +12,8 @@ from subprocess import CalledProcessError ...@@ -12,6 +12,8 @@ from subprocess import CalledProcessError
from poetry.core.packages.file_dependency import FileDependency from poetry.core.packages.file_dependency import FileDependency
from poetry.core.packages.utils.link import Link from poetry.core.packages.utils.link import Link
from poetry.io.null_io import NullIO 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 OrderedDict
from poetry.utils._compat import Path from poetry.utils._compat import Path
from poetry.utils._compat import cpu_count from poetry.utils._compat import cpu_count
...@@ -39,7 +41,7 @@ class Executor(object): ...@@ -39,7 +41,7 @@ class Executor(object):
self._chef = Chef(config, self._env) self._chef = Chef(config, self._env)
self._chooser = Chooser(pool, self._env) self._chooser = Chooser(pool, self._env)
if parallel: if parallel and not (PY2 and WINDOWS):
# This should be directly handled by ThreadPoolExecutor # This should be directly handled by ThreadPoolExecutor
# however, on some systems the number of CPUs cannot be determined # however, on some systems the number of CPUs cannot be determined
# (it raises a NotImplementedError), so, in this case, we assume # (it raises a NotImplementedError), so, in this case, we assume
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment