1
0
forked from VimPlug/jedi

Remove from_executable, were not really using it, yet.

This commit is contained in:
Dave Halter
2018-04-14 15:13:02 +02:00
parent 43ab9563e2
commit 9f07e7e352
3 changed files with 5 additions and 12 deletions

View File

@@ -42,5 +42,6 @@ from jedi.api import Script, Interpreter, set_debug_function, \
preload_module, names
from jedi import settings
from jedi.api.environment import find_virtualenvs, find_python_environments, \
get_default_environment, InvalidPythonEnvironment
get_default_environment, InvalidPythonEnvironment, create_environment, \
find_executable, get_python_environment
from jedi.api.exceptions import InternalError

View File

@@ -262,7 +262,7 @@ def get_python_environment(python):
raise InvalidPythonEnvironment("Cannot find executable %s." % python)
def create_environment(path, safe=False):
def create_environment(path, safe=True):
"""
Make it possible to create an environment by hand.
@@ -271,11 +271,6 @@ def create_environment(path, safe=False):
return _Environment(path, _get_executable_path(path, safe=safe))
def from_executable(executable):
path = os.path.dirname(os.path.dirname(executable))
return _Environment(path, executable)
def _get_executable_path(path, safe=True):
"""
Returns None if it's not actually a virtual env.

View File

@@ -3,7 +3,7 @@ import json
from jedi._compatibility import FileNotFoundError, NotADirectoryError
from jedi.api.environment import SameEnvironment, \
get_default_environment, from_executable
get_default_environment
from jedi.api.exceptions import WrongVersion
from jedi._compatibility import force_unicode
from jedi.evaluate.sys_path import discover_buildout_paths
@@ -30,9 +30,9 @@ def _force_unicode_list(lst):
class Project(object):
# TODO serialize environment
_serializer_ignore_attributes = ('_environment',)
_environment = None
_executable = None
@staticmethod
def _get_json_path(base_path):
@@ -49,8 +49,6 @@ class Project(object):
if version == 1:
self = cls.__new__()
self.__dict__.update(data)
if self._executable is not None:
self._environment = from_executable(self._executable)
return self
else:
raise WrongVersion(
@@ -72,7 +70,6 @@ class Project(object):
self._path = path
if isinstance(environment, SameEnvironment):
self._environment = environment
self._executable = environment._executable
self._sys_path = sys_path
self._smart_sys_path = smart_sys_path