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:
@@ -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_):
|
||||
|
||||
Reference in New Issue
Block a user