Skip to content

Commit 1cf11f5

Browse files
committed
Add SystemExit BaseException
1 parent 8c77f1a commit 1cf11f5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

vm/src/builtins.rs

+1
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,7 @@ pub fn make_module(vm: &VirtualMachine, module: PyObjectRef) {
889889
"UserWarning" => ctx.exceptions.user_warning.clone(),
890890

891891
"KeyboardInterrupt" => ctx.exceptions.keyboard_interrupt.clone(),
892+
"SystemExit" => ctx.exceptions.system_exit.clone(),
892893
});
893894
}
894895

vm/src/exceptions.rs

+3
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ pub struct ExceptionZoo {
252252
pub user_warning: PyClassRef,
253253

254254
pub keyboard_interrupt: PyClassRef,
255+
pub system_exit: PyClassRef,
255256
}
256257

257258
impl ExceptionZoo {
@@ -303,6 +304,7 @@ impl ExceptionZoo {
303304
let user_warning = create_type("UserWarning", &type_type, &warning);
304305

305306
let keyboard_interrupt = create_type("KeyboardInterrupt", &type_type, &base_exception_type);
307+
let system_exit = create_type("SystemExit", &type_type, &base_exception_type);
306308

307309
ExceptionZoo {
308310
arithmetic_error,
@@ -347,6 +349,7 @@ impl ExceptionZoo {
347349
reference_error,
348350
user_warning,
349351
keyboard_interrupt,
352+
system_exit,
350353
}
351354
}
352355
}

0 commit comments

Comments
 (0)