forked from VimPlug/jedi
Eliminate is_py3 usages
This commit is contained in:
@@ -7,7 +7,7 @@ mixing in Python code, the autocompletion should work much better for builtins.
|
||||
import os
|
||||
from itertools import chain
|
||||
|
||||
from jedi._compatibility import is_py3, unicode
|
||||
from jedi._compatibility import unicode
|
||||
|
||||
fake_modules = {}
|
||||
|
||||
|
||||
@@ -300,8 +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)
|
||||
)
|
||||
#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)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from abc import abstractproperty
|
||||
|
||||
from jedi._compatibility import is_py3
|
||||
from jedi import debug
|
||||
from jedi.evaluate import compiled
|
||||
from jedi.evaluate import filters
|
||||
@@ -136,7 +135,10 @@ class AbstractInstanceContext(Context):
|
||||
for generator in self.execute_function_slots(iter_slot_names):
|
||||
if isinstance(generator, AbstractInstanceContext):
|
||||
# `__next__` logic.
|
||||
name = '__next__' if is_py3 else 'next'
|
||||
if self.evaluator.environment.version_info.major == 2:
|
||||
name = 'next'
|
||||
else:
|
||||
name = '__next__'
|
||||
iter_slot_names = generator.get_function_slot_names(name)
|
||||
if iter_slot_names:
|
||||
yield LazyKnownContexts(
|
||||
|
||||
@@ -6,7 +6,6 @@ from abc import abstractmethod
|
||||
|
||||
from parso.tree import search_ancestor
|
||||
|
||||
from jedi._compatibility import is_py3
|
||||
from jedi.evaluate import flow_analysis
|
||||
from jedi.evaluate.base_context import ContextSet, Context
|
||||
from jedi.parser_utils import get_parent_scope
|
||||
|
||||
Reference in New Issue
Block a user