Add SystemExit BaseException

This commit is contained in:
ChJR committed 2019-09-25 00:26:04 +09:00
1 parent 8c77f1a1cf
commit 1cf11f5961
2 files changed
+4

No files matched your search

+1
View File
@@ -889,6 +889,7 @@ pub fn make_module(vm: &VirtualMachine, module: PyObjectRef) {
"UserWarning" => ctx.exceptions.user_warning.clone(),
"KeyboardInterrupt" => ctx.exceptions.keyboard_interrupt.clone(),
"SystemExit" => ctx.exceptions.system_exit.clone(),
});
}
+3
View File
@@ -252,6 +252,7 @@ pub struct ExceptionZoo {
pub user_warning: PyClassRef,
pub keyboard_interrupt: PyClassRef,
pub system_exit: PyClassRef,
}
impl ExceptionZoo {
@@ -303,6 +304,7 @@ impl ExceptionZoo {
let user_warning = create_type("UserWarning", &type_type, &warning);
let keyboard_interrupt = create_type("KeyboardInterrupt", &type_type, &base_exception_type);
let system_exit = create_type("SystemExit", &type_type, &base_exception_type);
ExceptionZoo {
arithmetic_error,
@@ -347,6 +349,7 @@ impl ExceptionZoo {
reference_error,
user_warning,
keyboard_interrupt,
system_exit,
}
}
}