'Raises errors for inotify failures.'

@staticmethod
def _raise_error():

    err = ctypes.get_errno()
    if (err == errno.ENOSPC):
        raise OSError('inotify    watch    limit    reached')
    elif (err == errno.EMFILE):
        raise OSError('inotify    instance    limit    reached')
    else:
        raise OSError(os.strerror(err))
