forked from VimPlug/jedi
Some more small improvements for Python 2
This commit is contained in:
@@ -344,7 +344,7 @@ class CompiledObjectFilter(AbstractFilter):
|
|||||||
|
|
||||||
# ``dir`` doesn't include the type names.
|
# ``dir`` doesn't include the type names.
|
||||||
if not self._is_instance and needs_type_completions:
|
if not self._is_instance and needs_type_completions:
|
||||||
for filter in builtin_from_name(self._evaluator, 'type').get_filters():
|
for filter in builtin_from_name(self._evaluator, u'type').get_filters():
|
||||||
names += filter.values()
|
names += filter.values()
|
||||||
return names
|
return names
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,10 @@ class _Subprocess(object):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def _send(self, evaluator_id, function, args=(), kwargs={}):
|
def _send(self, evaluator_id, function, args=(), kwargs={}):
|
||||||
|
if not is_py3:
|
||||||
|
# Python 2 compatibility
|
||||||
|
kwargs = {force_unicode(key): value for key, value in kwargs.items()}
|
||||||
|
|
||||||
data = evaluator_id, function, args, kwargs
|
data = evaluator_id, function, args, kwargs
|
||||||
pickle.dump(data, self._process.stdin, protocol=_PICKLE_PROTOCOL)
|
pickle.dump(data, self._process.stdin, protocol=_PICKLE_PROTOCOL)
|
||||||
self._process.stdin.flush()
|
self._process.stdin.flush()
|
||||||
@@ -294,9 +298,6 @@ class AccessHandle(object):
|
|||||||
happen. They are also the only unhashable objects that we're passing
|
happen. They are also the only unhashable objects that we're passing
|
||||||
around.
|
around.
|
||||||
"""
|
"""
|
||||||
# Python 2 compatibility
|
|
||||||
kwargs = {force_unicode(key): value for key, value in kwargs.items()}
|
|
||||||
|
|
||||||
if args and isinstance(args[0], slice):
|
if args and isinstance(args[0], slice):
|
||||||
return 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._cached_results(name, *args, **kwargs)
|
return self._cached_results(name, *args, **kwargs)
|
||||||
|
|||||||
Reference in New Issue
Block a user