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

Method _get_from_queue

mypy/moduleinspect.py:163–178  ·  view source on GitHub ↗

Get value from the queue. Return the value read from the queue, or None if the process unexpectedly died.

(self)

Source from the content-addressed store, hash-verified

161 return res
162
163 def _get_from_queue(self) -> ModuleProperties | str | None:
164 """Get value from the queue.
165
166 Return the value read from the queue, or None if the process unexpectedly died.
167 """
168 max_iter = 600
169 n = 0
170 while True:
171 if n == max_iter:
172 raise RuntimeError("Timeout waiting for subprocess")
173 try:
174 return self.results.get(timeout=0.05)
175 except queue.Empty:
176 if not self.proc.is_alive():
177 return None
178 n += 1
179
180 def __enter__(self) -> ModuleInspect:
181 return self

Callers 1

Calls 2

RuntimeErrorClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected