def test_EINTR(self):
        """
        L{KQueueReactor} handles L{errno.EINTR} in C{doKEvent} by returning.
        """
        class FakeKQueue(object):
            """
            A fake KQueue that raises L{errno.EINTR} when C{control} is called,
            like a real KQueue would if it was interrupted.
            """
            def control(self, *args, **kwargs):
                raise OSError(errno.EINTR, "Interrupted")

        reactor = KQueueReactor(makeFakeKQueue(FakeKQueue, _fakeKEvent))
        # This should return cleanly -- should not raise the OSError we're
        # spawning, nor get upset and raise about the incomplete KQueue fake.
        reactor.doKEvent(0)

        L{KQueueReactor} handles L{errno.EINTR} in C{doKEvent} by returning.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_kqueuereactor.py