Skip to content

Commit 33e9a67

Browse files
committed
Fix tab-completion crash when CompletionItem.descriptive_data is something other than a str.
1 parent 7ebdc8d commit 33e9a67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd2/pt_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def get_completions(self, document: Document, _complete_event: object) -> Iterab
104104
for i, match in enumerate(matches):
105105
display = display_matches[i] if use_display_matches else match
106106
display_meta = None
107-
if isinstance(match, CompletionItem) and match.descriptive_data:
107+
if isinstance(match, CompletionItem) and match.descriptive_data and isinstance(match.descriptive_data[0], str):
108108
display_meta = match.descriptive_data[0]
109109

110110
# prompt_toolkit replaces the word before cursor by default if we use the default Completer?

0 commit comments

Comments
 (0)