1
0
forked from VimPlug/jedi

Add a way to generalize Popen

This commit is contained in:
Dave Halter
2018-04-13 10:17:30 +02:00
parent 81623c6b5d
commit 83d635cbac
3 changed files with 14 additions and 4 deletions

View File

@@ -1,12 +1,13 @@
import os
import re
import sys
from subprocess import Popen, PIPE
from subprocess import PIPE
from collections import namedtuple
# When dropping Python 2.7 support we should consider switching to
# `shutil.which`.
from distutils.spawn import find_executable
from jedi._compatibility import GeneralizedPopen
from jedi.cache import memoize_method
from jedi.evaluate.compiled.subprocess import get_subprocess, \
EvaluatorSameProcess, EvaluatorSubprocess
@@ -54,7 +55,7 @@ class _Environment(_BaseEnvironment):
def _get_version(self):
try:
process = Popen([self.executable, '--version'], stdout=PIPE, stderr=PIPE)
process = GeneralizedPopen([self.executable, '--version'], stdout=PIPE, stderr=PIPE)
stdout, stderr = process.communicate()
retcode = process.poll()
if retcode: