Propagate exceptions raised in init.

This commit is contained in:
Adam Kelly committed 2018-08-09 18:56:38 +01:00
1 parent 3e07540afc
commit 2e165efbb6
1 file changed
+2 -1
+2 -1
View File
@@ -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)
}