From 0826ceb8baa9120c6d2c7454785a880b0ea72e79 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 10 May 2016 02:12:57 +0000 Subject: [PATCH] Commit missing parts of a5bb4a24. --- artiq/compiler/transforms/artiq_ir_generator.py | 2 +- artiq/test/lit/exceptions/error_raise_class.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 artiq/test/lit/exceptions/error_raise_class.py diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index ac74bdba3..4d8210c80 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -599,7 +599,7 @@ class ARTIQIRGenerator(algorithm.Visitor): self.append(ir.Reraise()) def visit_Raise(self, node): - if types.is_exn_constructor(node.exc.type): + if node.exc is not None and types.is_exn_constructor(node.exc.type): self.raise_exn(self.alloc_exn(node.exc.type.instance), loc=self.current_loc) else: self.raise_exn(self.visit(node.exc), loc=self.current_loc) diff --git a/artiq/test/lit/exceptions/error_raise_class.py b/artiq/test/lit/exceptions/error_raise_class.py deleted file mode 100644 index 3c85f0dc8..000000000 --- a/artiq/test/lit/exceptions/error_raise_class.py +++ /dev/null @@ -1,5 +0,0 @@ -# RUN: %python -m artiq.compiler.testbench.signature +diag %s >%t -# RUN: OutputCheck %s --file-to-check=%t - -# CHECK-L: ${LINE:+1}: note: this value is an exception constructor; use IndexError() instead -raise IndexError