MCPcopy Create free account
hub / github.com/ActiveState/code / SemError

Class SemError

recipes/Python/577655_POSIX_Semaphore_FreeBSD/recipe-577655.py:24–32  ·  view source on GitHub ↗

Exception for errors raised by the Sem class.

Source from the content-addressed store, hash-verified

22 return func
23
24class SemError(RuntimeError):
25 """Exception for errors raised by the Sem class."""
26 _error = get_func("libc.so", "__error", POINTER(c_int), ())
27 _strerror = get_func("libc.so", "strerror", c_char_p, (c_int,))
28
29 def __init__(self):
30 """Create an exception based on the value of errno"""
31 self.errno = self._error().contents.value
32 RuntimeError.__init__(self, self.errno, self._strerror(self.errno))
33
34class c_struct__usem(Structure):
35 """FreeBSD provate semaphore structure."""

Callers 8

__init__Method · 0.85
__del__Method · 0.85
getvalueMethod · 0.85
postMethod · 0.85
timedwaitMethod · 0.85
trywaitMethod · 0.85
unlinkMethod · 0.85
waitMethod · 0.85

Calls 2

POINTERFunction · 0.85
get_funcFunction · 0.70

Tested by

no test coverage detected