Ver código fonte

Minor tweaks in request_handler

Yentl Van Tendeloo 7 anos atrás
pai
commit
84f1693146

+ 5 - 6
kernel/modelverse_kernel/request_handler.py

@@ -49,10 +49,11 @@ class RequestHandler(object):
         # Append the server's replies to the list of replies.
         if reply is not None:
             gen = self.generator_stack[-1]
-            if gen["replies"] is None:
-                gen["replies"] = reply
-            else:
+
+            if gen["replies"]:
                 gen["replies"].extend(reply)
+            else:
+                gen["replies"] = reply
 
         while 1:
             # Silence pylint's warning about catching Exception.
@@ -113,9 +114,7 @@ class RequestHandler(object):
         if requests:
             if requests[0][0] in self.handlers:
                 # First element is a known request
-                #elem = requests.pop(0)
-                elem = requests[0]
-                del requests[0]
+                elem = requests.pop(0)
 
                 # The list of requests might be empty now. If so, then flag this
                 # batch of requests as finished.

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-Date:   Tue Apr 24 13:24:04 2018
+Date:   Tue Apr 24 13:37:14 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server