فهرست منبع

fix(code-runtime-python): guard the stdin destroy against a spawn-failure child

The boot-write-failure path's fake child carries no stdin handle, so the
unconditional destroy threw inside the spawn error handler and mislabeled the
worker-exit. Use the optional-call form; the no-stdin branch is exercised by
that same test.
Chinesezjc 2 هفته پیش
والد
کامیت
aecdec3f80
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      packages/code-runtime/code-runtime-python/src/index.ts

+ 1 - 1
packages/code-runtime/code-runtime-python/src/index.ts

@@ -995,7 +995,7 @@ export class PythonCodeRuntime extends CodeRuntime {
       // inheriting fd 0 would keep the host process from exiting even after the
       // closeDeadline forced settlement. The child (and any descendant) reads
       // EOF on fd 0 instead, and no host handle survives.
-      child.stdin.destroy()
+      child.stdin?.destroy()
     } catch (error: unknown) {
       try {
         rmSync(bootstrapDir, { recursive: true, force: true })