浏览代码

Refactor some code to use RUN in the kernel

jonathanvdc 8 年之前
父节点
当前提交
4ecfbfbf39
共有 1 个文件被更改,包括 2 次插入11 次删除
  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,