'The base class invoikes this method to notify the implementation to
modify an already registered file descriptor. The request must be
ignored if the poller is not activated.
:param int fileno: The file descriptor
:param int events: absolute events (READ, WRITE, ERROR)
:param int events_to_clear: The events to clear (READ, WRITE, ERROR)
:param int events_to_set: The events to set (READ, WRITE, ERROR)'

def _modify_fd_events(self, fileno, events, events_to_clear, events_to_set):

    if (self._kqueue is None):
        return
    kevents = list()
    if (events_to_clear & READ):
        kevents.append(select.kevent(fileno, filter=select.KQ_FILTER_READ, flags=select.KQ_EV_DELETE))
    if (events_to_set & READ):
        kevents.append(select.kevent(fileno, filter=select.KQ_FILTER_READ, flags=select.KQ_EV_ADD))
    if (events_to_clear & WRITE):
        kevents.append(select.kevent(fileno, filter=select.KQ_FILTER_WRITE, flags=select.KQ_EV_DELETE))
    if (events_to_set & WRITE):
        kevents.append(select.kevent(fileno, filter=select.KQ_FILTER_WRITE, flags=select.KQ_EV_ADD))
    self._kqueue.control(kevents, 0)
