Skip to content

Commit 2be2332

Browse files
committed
local provisioner: ensure pipes are cleaned up using Popen.__exit__
1 parent 321094a commit 2be2332

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jupyter_client/provisioning/local_provisioner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ async def wait(self) -> Optional[int]:
5959
await asyncio.sleep(0.1)
6060

6161
# Process is no longer alive, wait and clear
62-
ret = self.process.wait()
62+
# Popen.__exit__ cleans up resources such as pipes
63+
with self.process:
64+
ret = self.process.wait()
6365
self.process = None # allow has_process to now return False
6466
return ret
6567

0 commit comments

Comments
 (0)