mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +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.
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
from parso.python import tree
|
||||
import parso
|
||||
|
||||
@@ -104,7 +102,6 @@ class Evaluator(object):
|
||||
self.analysis = []
|
||||
self.dynamic_params_depth = 0
|
||||
self.is_analysis = False
|
||||
self.python_version = sys.version_info[:2]
|
||||
self.project = project
|
||||
self.access_cache = {}
|
||||
project.add_evaluator(self)
|
||||
|
||||
@@ -300,4 +300,8 @@ class AccessHandle(object):
|
||||
|
||||
@memoize_method
|
||||
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)
|
||||
|
||||
@@ -136,7 +136,7 @@ def builtins_next(evaluator, iterators, defaults):
|
||||
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.
|
||||
"""
|
||||
if evaluator.python_version[0] == 2:
|
||||
if evaluator.environment.version_info.major == 2:
|
||||
name = 'next'
|
||||
else:
|
||||
name = '__next__'
|
||||
|
||||
Reference in New Issue
Block a user