From 4fbcfa456e2baecb4e25f116412388f1a036f4c4 Mon Sep 17 00:00:00 2001 From: facelessuser Date: Wed, 4 Dec 2024 20:53:06 -0700 Subject: [PATCH] Docs: Notebook should display printed text before serialized objects --- docs/src/py/notebook.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/src/py/notebook.py b/docs/src/py/notebook.py index 06930554..4c121be0 100644 --- a/docs/src/py/notebook.py +++ b/docs/src/py/notebook.py @@ -503,12 +503,11 @@ def execute(cmd, no_except=True, inline=False, init='', g=None): with StreamOut() as s: # Execute code for x in evaluate(node, g): - result.append(x) - # Output captured standard out after statements text = s.read() if text: result.append(AtomicString(text)) + result.append(x) # Execution went well, so append command console += command