mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-08 22:45:16 +08:00
catch error in certain non-pep0484 annotations
This commit is contained in:
1 parent
8bf2fe77e2
commit
6bee214948
2 files changed
+15
-3
No files matched your search
@@ -29,7 +29,10 @@ def _evaluate_for_annotation(evaluator, annotation):
|
||||
if (isinstance(definition, CompiledObject) and
|
||||
isinstance(definition.obj, str)):
|
||||
p = Parser(load_grammar(), definition.obj)
|
||||
element = p.module.children[0].children[0]
|
||||
try:
|
||||
element = p.module.children[0].children[0]
|
||||
except (AttributeError, IndexError):
|
||||
continue
|
||||
element.parent = annotation.parent
|
||||
definitions |= evaluator.eval_element(element)
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user