1
0
forked from VimPlug/jedi

Change subclass to function wrapper

This avoids mypy complaining that we need to provide a generic
argument to Popen, which we cannot acctually do as the implementation
of Popen does not inherit from typing.Generic.
This commit is contained in:
Peter Law
2020-07-24 16:02:36 +01:00
parent 5e509814f7
commit 69be26b16e

View File

@@ -29,8 +29,7 @@ _MAIN_PATH = os.path.join(os.path.dirname(__file__), '__main__.py')
PICKLE_PROTOCOL = 4
class _GeneralizedPopen(subprocess.Popen):
def __init__(self, *args, **kwargs):
def _GeneralizedPopen(*args, **kwargs):
if os.name == 'nt':
try:
# Was introduced in Python 3.7.
@@ -41,7 +40,8 @@ class _GeneralizedPopen(subprocess.Popen):
# The child process doesn't need file descriptors except 0, 1, 2.
# This is unix only.
kwargs['close_fds'] = 'posix' in sys.builtin_module_names
super().__init__(*args, **kwargs)
return subprocess.Popen(*args, **kwargs)
def _enqueue_output(out, queue_):