Explorar o código

Refactor some code to use RUN in the kernel

jonathanvdc %!s(int64=8) %!d(string=hai) anos
pai
achega
4ecfbfbf39
Modificáronse 1 ficheiros con 2 adicións e 11 borrados
  1. 2 11
      kernel/modelverse_kernel/main.py

+ 2 - 11
kernel/modelverse_kernel/main.py

@@ -222,21 +222,12 @@ class ModelverseKernel(object):
                 raise Exception("%s: error understanding command (%s, %s)" % (self.debug_info[username], inst_v, self.phase_v))
 
         try:
-            inp = None
-            while 1:
-                inp = yield gen.send(inp)
-        except StopIteration:
-            pass
+            yield [("RUN", gen)]
         except jit.JitCompilationFailedException as e:
             # Try again, but this time without the JIT.
             # print(e.message)
             gen = self.get_inst_phase_generator(inst_v, self.phase_v, user_root)
-            try:
-                inp = None
-                while 1:
-                    inp = yield gen.send(inp)
-            except StopIteration:
-                pass
+            yield [("RUN", gen)]
 
     def get_inst_phase_generator(self, inst_v, phase_v, user_root):
         """Gets a generator for the given instruction in the given phase,