mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 23:04:48 +08:00
Fix os.path issues.
This commit is contained in:
@@ -87,15 +87,18 @@ class ImportWrapper(pr.Base):
|
|||||||
|
|
||||||
# follow the rest of the import (not FS -> classes, functions)
|
# follow the rest of the import (not FS -> classes, functions)
|
||||||
if len(rest) > 1 or rest and self.is_like_search:
|
if len(rest) > 1 or rest and self.is_like_search:
|
||||||
scopes = []
|
if ('os', 'path') == importer.str_import_path()[:2] \
|
||||||
if ('os', 'path') == self.import_path[:2] \
|
and self._import.level == 0:
|
||||||
and not self._is_relative_import():
|
|
||||||
# This is a huge exception, we follow a nested import
|
# This is a huge exception, we follow a nested import
|
||||||
# ``os.path``, because it's a very important one in Python
|
# ``os.path``, because it's a very important one in Python
|
||||||
# that is being achieved by messing with ``sys.modules`` in
|
# that is being achieved by messing with ``sys.modules`` in
|
||||||
# ``os``.
|
# ``os``.
|
||||||
raise NotImplementedError
|
for r in rest:
|
||||||
scopes = self._evaluator.follow_path(iter(rest), [module], module)
|
scopes = list(chain.from_iterable(
|
||||||
|
self._evaluator.find_types(s, r)
|
||||||
|
for s in scopes))
|
||||||
|
else:
|
||||||
|
scopes = []
|
||||||
elif rest:
|
elif rest:
|
||||||
if is_goto:
|
if is_goto:
|
||||||
scopes = list(chain.from_iterable(
|
scopes = list(chain.from_iterable(
|
||||||
|
|||||||
Reference in New Issue
Block a user