示例#1
0
文件: protocol.py 项目: esh/invaders
 def wait(self):
     """The difference from Queue.wait: if there is an only item in the
     Queue and it is an exception, raise it, but keep it in the Queue, so
     that future calls to wait() will raise it again.
     """
     if self.has_error() and len(self.items)==1:
         # the last item, which is an exception, raise without emptying the Queue
         getcurrent().throw(*self.items[0][1])
     else:
         return Queue.wait(self)
示例#2
0
 def wait(self):
     """The difference from Queue.wait: if there is an only item in the
     Queue and it is an exception, raise it, but keep it in the Queue, so
     that future calls to wait() will raise it again.
     """
     if self.has_error() and len(self.items) == 1:
         # the last item, which is an exception, raise without emptying the Queue
         getcurrent().throw(*self.items[0][1])
     else:
         return Queue.wait(self)
示例#3
0
文件: protocol.py 项目: esh/invaders
 def send(self, value=None, exc=None):
     if exc is not None or not self.has_error():
         Queue.send(self, value, exc)
示例#4
0
 def send(self, value=None, exc=None):
     if exc is not None or not self.has_error():
         Queue.send(self, value, exc)