Method
__del__
(self,
# localize module access to prevent shutdown errors
_wait=_winapi.WaitForSingleObject,
_close=_winapi.CloseHandle,
_signal=_overlapped.SetEvent)
Source from the content-addressed store, hash-verified
| 110 | return |
| 111 | |
| 112 | def __del__(self, |
| 113 | # localize module access to prevent shutdown errors |
| 114 | _wait=_winapi.WaitForSingleObject, |
| 115 | _close=_winapi.CloseHandle, |
| 116 | _signal=_overlapped.SetEvent): |
| 117 | if self._running is not None: |
| 118 | # tell the update thread to quit |
| 119 | _signal(self._running) |
| 120 | # wait for the update thread to signal done |
| 121 | _wait(self._stopped, -1) |
| 122 | # cleanup events |
| 123 | _close(self._running) |
| 124 | _close(self._stopped) |
| 125 | self._running = self._stopped = None |
| 126 | |
| 127 | def getloadavg(self): |
| 128 | return self._load |
Tested by
no test coverage detected