Get value from the queue. Return the value read from the queue, or None if the process unexpectedly died.
(self)
| 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 |
no test coverage detected