mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
Improved static analysis for imports.
This commit is contained in:
@@ -104,11 +104,12 @@ class ImportWrapper(pr.Base):
|
|||||||
|
|
||||||
if from_import_name is not None:
|
if from_import_name is not None:
|
||||||
types = list(chain.from_iterable(
|
types = list(chain.from_iterable(
|
||||||
self._evaluator.find_types(s, from_import_name, is_goto=is_goto)
|
self._evaluator.find_types(s, unicode(from_import_name),
|
||||||
|
is_goto=is_goto)
|
||||||
for s in types))
|
for s in types))
|
||||||
if not types:
|
if not types:
|
||||||
importer = get_importer(self._evaluator,
|
path = import_path + [from_import_name]
|
||||||
tuple(import_path + [from_import_name]),
|
importer = get_importer(self._evaluator, tuple(path),
|
||||||
module, self._import.level)
|
module, self._import.level)
|
||||||
types = importer.follow_file_system()
|
types = importer.follow_file_system()
|
||||||
# goto only accepts `Name`
|
# goto only accepts `Name`
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ date.today
|
|||||||
#! 5 attribute-error
|
#! 5 attribute-error
|
||||||
date.not_existing_attribute
|
date.not_existing_attribute
|
||||||
|
|
||||||
#! 26 import-error
|
#! 14 import-error
|
||||||
from datetime.date import today
|
from datetime.date import today
|
||||||
|
|
||||||
#! 16 import-error
|
#! 16 import-error
|
||||||
|
|||||||
Reference in New Issue
Block a user