MCPcopy Create free account
hub / github.com/python/mypy / check_status

Function check_status

mypy/dmypy/client.py:699–718  ·  view source on GitHub ↗

Check if the process is alive. Return (pid, connection_name) on success. Raise BadStatus if something's wrong.

(data: dict[str, Any])

Source from the content-addressed store, hash-verified

697
698
699def check_status(data: dict[str, Any]) -> tuple[int, str]:
700 """Check if the process is alive.
701
702 Return (pid, connection_name) on success.
703
704 Raise BadStatus if something's wrong.
705 """
706 if "pid" not in data:
707 raise BadStatus("Invalid status file (no pid field)")
708 pid = data["pid"]
709 if not isinstance(pid, int):
710 raise BadStatus("pid field is not an int")
711 if not alive(pid):
712 raise BadStatus("Daemon has died")
713 if "connection_name" not in data:
714 raise BadStatus("Invalid status file (no connection_name field)")
715 connection_name = data["connection_name"]
716 if not isinstance(connection_name, str):
717 raise BadStatus("connection_name field is not a string")
718 return pid, connection_name
719
720
721def is_running(status_file: str) -> bool:

Callers 3

wait_for_serverFunction · 0.85
do_statusFunction · 0.85
get_statusFunction · 0.85

Calls 3

BadStatusClass · 0.90
aliveFunction · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…