A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
Fix: stream restoration order (#660)
Akshay Agrawal893c48c3950d
diff --git a/marimo/_runtime/redirect_streams.py b/marimo/_runtime/redirect_streams.pyindex 4be70d2ebe..0cf7b298fc 100644--- a/marimo/_runtime/redirect_streams.py+++ b/marimo/_runtime/redirect_streams.py@@ -66,10 +66,14 @@ def redirect_streams(sys.stderr = stderr # type: ignoresys.stdin = stdin # type: ignore- with redirect(stdout, py_stdout.fileno()), redirect(- stderr, py_stderr.fileno()- ):- yield+ try:+ with redirect(stdout, py_stdout.fileno()), redirect(+ stderr, py_stderr.fileno()+ ):+ yield+ finally:+ # These have to be restored after the redirect context managers have+ # exitedsys.stdout = py_stdoutsys.stderr = py_stderrsys.stdin = py_stdin