From 6e5db3f47937a88e6409406ee428ed9977abe9f4 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 13 Nov 2022 18:26:01 +0100 Subject: [PATCH] Fix a weird AttributeError, fixes #1765 --- jedi/api/helpers.py | 2 +- test/test_api/test_call_signatures.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/jedi/api/helpers.py b/jedi/api/helpers.py index e8ce3881..273433e2 100644 --- a/jedi/api/helpers.py +++ b/jedi/api/helpers.py @@ -306,7 +306,7 @@ def _iter_arguments(nodes, position): first = node.children[0] second = node.children[1] if second == '=': - if second.start_pos < position: + if second.start_pos < position and first.type == 'name': yield 0, first.value, True else: yield 0, remove_after_pos(first), False diff --git a/test/test_api/test_call_signatures.py b/test/test_api/test_call_signatures.py index f7b5618a..e8741671 100644 --- a/test/test_api/test_call_signatures.py +++ b/test/test_api/test_call_signatures.py @@ -650,6 +650,7 @@ def test_cursor_after_signature(Script, column): ('abs(chr ( \nclass y: pass', 1, 8, 'abs', 0), ('abs(chr ( \nclass y: pass', 1, 9, 'abs', 0), ('abs(chr ( \nclass y: pass', 1, 10, 'chr', 0), + ('abs(foo.bar=3)', 1, 13, 'abs', 0), ] ) def test_base_signatures(Script, code, line, column, name, index):