1
0
forked from VimPlug/jedi

Fix the weird py__path__ behavior

This commit is contained in:
Dave Halter
2019-08-21 23:08:42 +02:00
parent 592f3771fc
commit 2fb04db0ab
7 changed files with 49 additions and 54 deletions

View File

@@ -273,7 +273,13 @@ class DirectObjectAccess(object):
return [self._create_access_path(base) for base in self._obj.__bases__]
def py__path__(self):
return self._obj.__path__
paths = getattr(self._obj, '__path__', None)
# Avoid some weird hacks that would just fail, because they cannot be
# used by pickle.
if not isinstance(paths, list) \
or not all(isinstance(p, (bytes, unicode)) for p in paths):
return None
return paths
@_force_unicode_decorator
def get_repr(self):