mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 11:14:38 +08:00
Propagate exceptions raised in init.
This commit is contained in:
1 parent
3e07540afc
commit
2e165efbb6
1 file changed
+2
-1
+2
-1
@@ -483,7 +483,8 @@ impl VirtualMachine {
|
||||
let init = type_ref.get_attr(&String::from("__init__"));
|
||||
let mut self_args = PyFuncArgs { args: args.args };
|
||||
self_args.args.insert(0, obj.clone());
|
||||
self.invoke(init, self_args).unwrap();
|
||||
self.invoke(init, self_args)?;
|
||||
// TODO Raise TypeError if init returns not None.
|
||||
Ok(obj)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user