check for events, returning one event

def poll(self):
        '''check for events, returning one event'''
        if self.out_queue.qsize() <= 0:
            return None
        evt = self.out_queue.get()
        while isinstance(evt, win_layout.WinLayout):
            win_layout.set_layout(evt, self.set_layout)
            if self.out_queue.qsize() == 0:
                return None
            evt = self.out_queue.get()
        return evt