From 8f95a362d21ca74b107a4b3cc18ca4b9bcaa2764 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozachuk Date: Fri, 20 Oct 2023 14:02:09 +0200 Subject: [PATCH] Fix source_code function with the dynamic answer class. --- chatmastermind/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatmastermind/message.py b/chatmastermind/message.py index 97e3e3a..e8b19ba 100644 --- a/chatmastermind/message.py +++ b/chatmastermind/message.py @@ -51,7 +51,7 @@ def source_code(text: str, include_delims: bool = False) -> list[str]: code_lines: list[str] = [] in_code_block = False - for line in text.split('\n'): + for line in str(text).split('\n'): if line.strip().startswith('```'): if include_delims: code_lines.append(line)