diff --git a/jedi/evaluate/compiled/context.py b/jedi/evaluate/compiled/context.py index f4230e56..652834f9 100644 --- a/jedi/evaluate/compiled/context.py +++ b/jedi/evaluate/compiled/context.py @@ -344,7 +344,7 @@ class CompiledObjectFilter(AbstractFilter): # ``dir`` doesn't include the type names. 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() return names diff --git a/jedi/evaluate/compiled/subprocess/__init__.py b/jedi/evaluate/compiled/subprocess/__init__.py index 81c01204..7b0ef74c 100644 --- a/jedi/evaluate/compiled/subprocess/__init__.py +++ b/jedi/evaluate/compiled/subprocess/__init__.py @@ -142,6 +142,10 @@ class _Subprocess(object): ) 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 pickle.dump(data, self._process.stdin, protocol=_PICKLE_PROTOCOL) self._process.stdin.flush() @@ -294,9 +298,6 @@ class AccessHandle(object): happen. They are also the only unhashable objects that we're passing around. """ - # Python 2 compatibility - kwargs = {force_unicode(key): value for key, value in kwargs.items()} - if args and isinstance(args[0], slice): return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs) return self._cached_results(name, *args, **kwargs)