X-Git-Url: https://git.llucax.com/software/pymin.git/blobdiff_plain/ac5053f5816193893e962448544daab87a975df2..70ec9c970b451ee166087a3327a6b906a4777500:/eventloop.py?ds=sidebyside diff --git a/eventloop.py b/eventloop.py index acc370a..06922a7 100644 --- a/eventloop.py +++ b/eventloop.py @@ -9,14 +9,30 @@ Please see EventLoop class documentation for more info. import select from select import POLLIN, POLLPRI, POLLERR -__ALL__ = ('EventLoop') +__ALL__ = ('EventLoop', 'LoopInterruptedError') class LoopInterruptedError(RuntimeError): + r""" + LoopInterruptedError(select_error) -> LoopInterruptedError instance. + + This class is raised when the event loop is interrupted in an unexpected + way. It wraps a select error, which can be accessed using the 'select_error' + attribute. + """ + def __init__(self, select_error): + r"""Initialize the object. + + See the class documentation for more info. + """ self.select_error = select_error + def __repr__(self): + r"repr(obj) -> Object representation." return 'LoopInterruptedError(select_error=%r)' % self.select_error + def __str__(self): + r"str(obj) -> String representation." return 'Loop interrupted: %s' % self.select_error class EventLoop: