1
0
forked from VimPlug/jedi

Move the initial sys path generation into a new project class.

This commit is contained in:
Dave Halter
2017-10-02 20:19:47 +02:00
parent 0762c9218c
commit 383f749026
10 changed files with 42 additions and 26 deletions

24
jedi/evaluate/project.py Normal file
View File

@@ -0,0 +1,24 @@
import os
import sys
from jedi.evaluate.sys_path import get_venv_path
class Project(object):
def __init__(self, sys_path=None):
if sys_path is None:
venv = os.getenv('VIRTUAL_ENV')
if venv:
sys_path = get_venv_path(venv)
if sys_path is None:
sys_path = sys.path
sys_path = list(sys_path)
try:
sys_path.remove('')
except ValueError:
pass
self.sys_path = sys_path