MCPcopy Index your code
hub / github.com/python/cpython / _internal_poll

Method _internal_poll

Lib/subprocess.py:1631–1645  ·  view source on GitHub ↗

Check if child process has terminated. Returns returncode attribute. This method is called by __del__, so it can only refer to objects in its local scope.

(self, _deadstate=None,
                _WaitForSingleObject=_winapi.WaitForSingleObject,
                _WAIT_OBJECT_0=_winapi.WAIT_OBJECT_0,
                _GetExitCodeProcess=_winapi.GetExitCodeProcess)

Source from the content-addressed store, hash-verified

1629 _winapi.CloseHandle(ht)
1630
1631 def _internal_poll(self, _deadstate=None,
1632 _WaitForSingleObject=_winapi.WaitForSingleObject,
1633 _WAIT_OBJECT_0=_winapi.WAIT_OBJECT_0,
1634 _GetExitCodeProcess=_winapi.GetExitCodeProcess):
1635 """Check if child process has terminated. Returns returncode
1636 attribute.
1637
1638 This method is called by __del__, so it can only refer to objects
1639 in its local scope.
1640
1641 """
1642 if self.returncode is None:
1643 if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0:
1644 self.returncode = _GetExitCodeProcess(self._handle)
1645 return self.returncode
1646
1647
1648 def _wait(self, timeout):

Callers 3

__del__Method · 0.95
pollMethod · 0.95
_cleanupFunction · 0.80

Calls 3

_handle_exitstatusMethod · 0.95
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected