From 28179a9c0f30c3cb9dbbc75588d2ae719bec0f68 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 6 Aug 2023 20:16:54 +0200 Subject: [PATCH] Have py command send strings except on client_raw flag. Resolve #3245 --- CHANGELOG.md | 1 + evennia/commands/default/system.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1a0f074c7..0b2d1ca233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ responses from an LLM server. - Fix: Make sure `at_server_reload` is called also on non-repeating Scripts. - Fix: Webclient was not giving a proper error when sending an unknown outputfunc to it. +- Fix: Make `py` command always send strings unless `client_raw` flag is set. - Documentation fixes. ## Evennia 2.1.0 diff --git a/evennia/commands/default/system.py b/evennia/commands/default/system.py index 92e3ea3085..e4c22664e2 100644 --- a/evennia/commands/default/system.py +++ b/evennia/commands/default/system.py @@ -239,7 +239,11 @@ def _run_code_snippet( if ret is None: return - elif isinstance(ret, tuple): + + if not client_raw: + ret = str(ret) + + if isinstance(ret, tuple): # we must convert here to allow msg to pass it (a tuple is confused # with a outputfunc structure) ret = str(ret)