Make the subprocesses work and return the right sys paths for the different versions

This commit is contained in:
Dave Halter
2017-11-15 08:58:13 +01:00
parent 96149d2e6a
commit 4136dcaf08
6 changed files with 53 additions and 41 deletions
@@ -7,6 +7,7 @@ goals:
2. Make it possible to handle different Python versions as well as virtualenvs.
"""
import os
import sys
import subprocess
import weakref
@@ -20,6 +21,8 @@ _PICKLE_PROTOCOL = 2
_subprocesses = {}
_MAIN_PATH = os.path.join(os.path.dirname(__file__), '__main__.py')
def get_subprocess(executable):
try:
@@ -88,8 +91,12 @@ class _Subprocess(object):
class _CompiledSubprocess(_Subprocess):
def __init__(self, executable):
parso_path = sys.modules['parso'].__file__
super(_CompiledSubprocess, self).__init__(
(executable, '-m', 'jedi.evaluate.compiled.subprocess')
(executable,
_MAIN_PATH,
os.path.dirname(os.path.dirname(parso_path))
)
)
def run(self, evaluator, function, *args, **kwargs):