From 78e0d6ac1ae42d2c44e2d23eab5b8149bc71e396 Mon Sep 17 00:00:00 2001 From: Adrian Dombeck Date: Sat, 8 Nov 2025 11:14:16 +0100 Subject: [PATCH] Fix REPL exiting when keywords have no shortdoc The `keywords` command failed when there were keywords which don't have a shortdoc, causing the REPL to exit and the logs to show AttributeError: 'KeywordDoc' object has no attribute 'hasattr' This change fixes that by only printing the shortdoc if there is one defined for the keyword. --- RobotDebug/debugcmd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RobotDebug/debugcmd.py b/RobotDebug/debugcmd.py index b04e847..2539735 100644 --- a/RobotDebug/debugcmd.py +++ b/RobotDebug/debugcmd.py @@ -160,7 +160,10 @@ def do_keywords(self, args): if lib: print_output("< Keywords of library", lib.name) for keyword in get_lib_keywords(lib): - print_output(f" {keyword.name}\t", keyword.shortdoc) + shortdoc = "" + if hasattr(keyword, "shortdoc"): + shortdoc = keyword.shortdoc.split("\n")[0] + print_output(f" {keyword.name}\t", shortdoc) do_k = do_keywords