|
@@ -22,16 +22,12 @@ class RequestHandler(object):
|
|
|
|
|
|
# Generated new request, so process
|
|
|
if requests and requests[0][0] in self.handlers:
|
|
|
- # Known request, so process that one
|
|
|
- if len(requests) > 1:
|
|
|
- raise Exception("CALL_* and SLEEP operations MUST be split in individual yields")
|
|
|
-
|
|
|
- # Try to add a new generator to branch into
|
|
|
- reply = None
|
|
|
- self.generator_stack.append(None)
|
|
|
- # This next command potentially raises a finished message already, meaning that we should stop already
|
|
|
- # We avoid an extra try/except block by putting the None on the stack already
|
|
|
- self.generator_stack[-1] = self.handlers[requests[0][0]](requests[0][1])
|
|
|
+ # Try to add a new generator to branch into
|
|
|
+ reply = None
|
|
|
+ self.generator_stack.append(None)
|
|
|
+ # This next command potentially raises a finished message already, meaning that we should stop already
|
|
|
+ # We avoid an extra try/except block by putting the None on the stack already
|
|
|
+ self.generator_stack[-1] = self.handlers[requests[0][0]](requests[0][1])
|
|
|
else:
|
|
|
# MvS request, so forward that instead
|
|
|
return requests
|