mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-24 17:28:36 +08:00
Not all nodes have children, protect agaisnt it.
This commit is contained in:
@@ -113,7 +113,7 @@ def _expand_typestr(type_str):
|
|||||||
elif type_str.startswith('{'):
|
elif type_str.startswith('{'):
|
||||||
node = parse(type_str, version='3.7').children[0]
|
node = parse(type_str, version='3.7').children[0]
|
||||||
if node.type == 'atom':
|
if node.type == 'atom':
|
||||||
for leaf in node.children[1].children:
|
for leaf in getattr(node.children[1], "children", []):
|
||||||
if leaf.type == 'number':
|
if leaf.type == 'number':
|
||||||
if '.' in leaf.value:
|
if '.' in leaf.value:
|
||||||
yield 'float'
|
yield 'float'
|
||||||
|
|||||||
Reference in New Issue
Block a user