mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +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:
|
||||
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))
|
||||
if not types:
|
||||
importer = get_importer(self._evaluator,
|
||||
tuple(import_path + [from_import_name]),
|
||||
path = import_path + [from_import_name]
|
||||
importer = get_importer(self._evaluator, tuple(path),
|
||||
module, self._import.level)
|
||||
types = importer.follow_file_system()
|
||||
# goto only accepts `Name`
|
||||
|
||||
@@ -14,7 +14,7 @@ date.today
|
||||
#! 5 attribute-error
|
||||
date.not_existing_attribute
|
||||
|
||||
#! 26 import-error
|
||||
#! 14 import-error
|
||||
from datetime.date import today
|
||||
|
||||
#! 16 import-error
|
||||
|
||||
Reference in New Issue
Block a user