1
0
forked from VimPlug/jedi

Move GeneralizedPopen

This commit is contained in:
Dave Halter
2020-07-02 10:54:32 +02:00
parent 0c1ba1b305
commit 216ce8726c
2 changed files with 17 additions and 18 deletions
-15
View File
@@ -48,18 +48,3 @@ def pickle_dump(data, file, protocol):
if sys.platform == 'win32':
raise IOError(errno.EPIPE, "Broken pipe")
raise
class GeneralizedPopen(subprocess.Popen):
def __init__(self, *args, **kwargs):
if os.name == 'nt':
try:
# Was introduced in Python 3.7.
CREATE_NO_WINDOW = subprocess.CREATE_NO_WINDOW
except AttributeError:
CREATE_NO_WINDOW = 0x08000000
kwargs['creationflags'] = CREATE_NO_WINDOW
# 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(GeneralizedPopen, self).__init__(*args, **kwargs)