mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Propagate exceptions raised in init.
This commit is contained in:
@@ -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