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