mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Don't use python_version directly on evaluator anymore
This commit is contained in:
@@ -62,8 +62,6 @@ only *evaluates* what needs to be *evaluated*. All the statements and modules
|
|||||||
that are not used are just being ignored.
|
that are not used are just being ignored.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from parso.python import tree
|
from parso.python import tree
|
||||||
import parso
|
import parso
|
||||||
|
|
||||||
@@ -104,7 +102,6 @@ class Evaluator(object):
|
|||||||
self.analysis = []
|
self.analysis = []
|
||||||
self.dynamic_params_depth = 0
|
self.dynamic_params_depth = 0
|
||||||
self.is_analysis = False
|
self.is_analysis = False
|
||||||
self.python_version = sys.version_info[:2]
|
|
||||||
self.project = project
|
self.project = project
|
||||||
self.access_cache = {}
|
self.access_cache = {}
|
||||||
project.add_evaluator(self)
|
project.add_evaluator(self)
|
||||||
|
|||||||
@@ -300,4 +300,8 @@ class AccessHandle(object):
|
|||||||
|
|
||||||
@memoize_method
|
@memoize_method
|
||||||
def _cached_results(self, name, *args, **kwargs):
|
def _cached_results(self, name, *args, **kwargs):
|
||||||
|
if type(self._subprocess) == EvaluatorSubprocess:
|
||||||
|
print(name, args, kwargs,
|
||||||
|
self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs)
|
||||||
|
)
|
||||||
return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs)
|
return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs)
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ def builtins_next(evaluator, iterators, defaults):
|
|||||||
TODO this function is currently not used. It's a stab at implementing next
|
TODO this function is currently not used. It's a stab at implementing next
|
||||||
in a different way than fake objects. This would be a bit more flexible.
|
in a different way than fake objects. This would be a bit more flexible.
|
||||||
"""
|
"""
|
||||||
if evaluator.python_version[0] == 2:
|
if evaluator.environment.version_info.major == 2:
|
||||||
name = 'next'
|
name = 'next'
|
||||||
else:
|
else:
|
||||||
name = '__next__'
|
name = '__next__'
|
||||||
|
|||||||
Reference in New Issue
Block a user