Skip to content

Commit 8c5677a

Browse files
committed
Guard repeated REPL init logging (skip when backend already ready)
1 parent 9a11981 commit 8c5677a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/lib/pyodide/backend/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ export const replState = {
9999
export async function init(): Promise<void> {
100100
const backend = getBackend();
101101

102+
// Idempotent: several callers invoke init() (auto-detect, toolbox installer,
103+
// first run, helper injection). The backend init itself is a no-op once
104+
// ready, but logging/callback setup ran every time, producing repeated
105+
// "Initializing Python REPL..." noise. Bail early when ready.
106+
if (backend.isReady()) return;
107+
102108
// Set up console output callbacks
103109
backend.onStdout((value) => consoleStore.output(value));
104110
backend.onStderr((value) => consoleStore.error(value));

0 commit comments

Comments
 (0)