From f52d3648067be41caaf8ab3ed4d9b35b48bb5f8f Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 30 Dec 2015 15:33:30 +0800 Subject: [PATCH] Mollify PEP 0479. --- artiq/compiler/ir.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/artiq/compiler/ir.py b/artiq/compiler/ir.py index 645a7f3c4..82a1bf4d6 100644 --- a/artiq/compiler/ir.py +++ b/artiq/compiler/ir.py @@ -236,7 +236,10 @@ class Phi(Instruction): def incoming(self): operand_iter = iter(self.operands) while True: - yield next(operand_iter), next(operand_iter) + try: + yield next(operand_iter), next(operand_iter) + except StopIteration: + return def incoming_blocks(self): return (block for (block, value) in self.incoming())