Merge pull request #1413 from ChJR/hotfix/exit

Fix exit()
This commit is contained in:
Jeong YunWon authored and GitHub committed 2019-09-26 20:16:08 +09:00
commit f209929dbc
3 files changed
+8

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
from testutils import assert_raises
with assert_raises(SystemExit):
exit()
+1
View File
@@ -883,6 +883,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,
}
}
}