MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _wait

Method _wait

tools/python-3.11.9-amd64/Lib/subprocess.py:1580–1595  ·  view source on GitHub ↗

Internal implementation of wait() on Windows.

(self, timeout)

Source from the content-addressed store, hash-verified

1578
1579
1580 def _wait(self, timeout):
1581 """Internal implementation of wait() on Windows."""
1582 if timeout is None:
1583 timeout_millis = _winapi.INFINITE
1584 elif timeout <= 0:
1585 timeout_millis = 0
1586 else:
1587 timeout_millis = int(timeout * 1000)
1588 if self.returncode is None:
1589 # API note: Returns immediately if timeout_millis == 0.
1590 result = _winapi.WaitForSingleObject(self._handle,
1591 timeout_millis)
1592 if result == _winapi.WAIT_TIMEOUT:
1593 raise TimeoutExpired(self.args, timeout)
1594 self.returncode = _winapi.GetExitCodeProcess(self._handle)
1595 return self.returncode
1596
1597
1598 def _readerthread(self, fh, buffer):

Callers 3

__exit__Method · 0.95
communicateMethod · 0.95
waitMethod · 0.95

Calls 8

_try_waitMethod · 0.95
_handle_exitstatusMethod · 0.95
_remaining_timeMethod · 0.95
TimeoutExpiredClass · 0.85
minFunction · 0.85
sleepMethod · 0.80
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected