Skip to content

Commit

Permalink
Docs: Notebook should display printed text before serialized objects
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Dec 5, 2024
1 parent 96a83a0 commit 4fbcfa4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docs/src/py/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4fbcfa4

Please sign in to comment.