MCPcopy Index your code
hub / github.com/python/mypy / __exit__

Method __exit__

mypy/ipc.py:310–326  ·  view source on GitHub ↗
(
        self,
        exc_ty: type[BaseException] | None = None,
        exc_val: BaseException | None = None,
        exc_tb: TracebackType | None = None,
    )

Source from the content-addressed store, hash-verified

308 return self
309
310 def __exit__(
311 self,
312 exc_ty: type[BaseException] | None = None,
313 exc_val: BaseException | None = None,
314 exc_tb: TracebackType | None = None,
315 ) -> None:
316 if sys.platform == "win32":
317 try:
318 # Wait for the client to finish reading the last write before disconnecting
319 if not FlushFileBuffers(self.connection):
320 raise IPCException(
321 "Failed to flush NamedPipe buffer, maybe the client hung up?"
322 )
323 finally:
324 DisconnectNamedPipe(self.connection)
325 else:
326 self.close()
327
328 def cleanup(self) -> None:
329 if sys.platform == "win32":

Callers

nothing calls this directly

Calls 2

IPCExceptionClass · 0.85
closeMethod · 0.45

Tested by

no test coverage detected