def throw(self, exc):
    if (self.queue is None):
        raise StopIteration
    self.queue.put((False, exc))
def throw(self, exc):
    if (self.queue is None):
        raise StopIteration
    self.queue.put((False, exc))