def _getWriters(reactor):
    """
    Like L{IReactorFDSet.getWriters}, but with support for IOCP reactor as
    well.
    """
    if IReactorFDSet.providedBy(reactor):
        return reactor.getWriters()
    elif 'IOCP' in reactor.__class__.__name__:
        return reactor.handles
    else:
        # Cannot tell what is going on.
        raise Exception("Cannot find writers on %r" % (reactor,))

    Like L{IReactorFDSet.getWriters}, but with support for IOCP reactor as
    well.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/connectionmixins.py