forked from M-Labs/nac3
nac3artiq: bail early on non-NAC3 classes
This commit is contained in:
parent
c004da85f7
commit
612b6768c0
|
@ -120,13 +120,16 @@ impl Nac3 {
|
||||||
ref mut bases,
|
ref mut bases,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
let kernels = decorator_list.iter().any(|decorator| {
|
let nac3_class = decorator_list.iter().any(|decorator| {
|
||||||
if let ast::ExprKind::Name { id, .. } = decorator.node {
|
if let ast::ExprKind::Name { id, .. } = decorator.node {
|
||||||
id.to_string() == "nac3"
|
id.to_string() == "nac3"
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if !nac3_class {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// Drop unregistered (i.e. host-only) base classes.
|
// Drop unregistered (i.e. host-only) base classes.
|
||||||
bases.retain(|base| {
|
bases.retain(|base| {
|
||||||
Python::with_gil(|py| -> PyResult<bool> {
|
Python::with_gil(|py| -> PyResult<bool> {
|
||||||
|
@ -157,7 +160,7 @@ impl Nac3 {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
kernels
|
true
|
||||||
}
|
}
|
||||||
ast::StmtKind::FunctionDef {
|
ast::StmtKind::FunctionDef {
|
||||||
ref decorator_list, ..
|
ref decorator_list, ..
|
||||||
|
|
Loading…
Reference in New Issue