diff --git a/src/qibo/_openqasm.py b/src/qibo/_openqasm.py index d5f6437da8..f548e951f7 100644 --- a/src/qibo/_openqasm.py +++ b/src/qibo/_openqasm.py @@ -230,7 +230,7 @@ def _get_gate(self, gate): qubits, init_args ) # the gate exists in self.defined_gates but invalid construction - except TypeError: + except ValueError: raise_error( ValueError, f"Invalid gate declaration at span: {gate.span}" )