mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 11:14:38 +08:00
Add SystemExit BaseException
This commit is contained in:
1 parent
8c77f1a1cf
commit
1cf11f5961
2 files changed
+4
No files matched your search
@@ -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(),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user