This commit is contained in:
blueloveTH 2023-06-04 22:30:32 +08:00
parent 66a60ab37f
commit ada232c079
2 changed files with 11 additions and 4 deletions

View File

@ -328,10 +328,10 @@ int main(int argc, char** argv) {
//at such a time this interferes with a real world use case of the bindings //at such a time this interferes with a real world use case of the bindings
//we can revisit it //we can revisit it
// //
//check(pkpy_vm_run(vm, "def error_from_python() : raise NotImplementedError()")); check(pkpy_vm_run(vm, "def error_from_python() : raise NotImplementedError()"));
//check(pkpy_push_function(vm, test_nested_error, 0)); check(pkpy_push_function(vm, test_nested_error, 0));
//check(pkpy_set_global(vm, "test_nested_error")); check(pkpy_set_global(vm, "test_nested_error"));
//error(pkpy_vm_run(vm, "test_nested_error()")); error(pkpy_vm_run(vm, "test_nested_error()"));
check(pkpy_vm_run(vm, "import math")); check(pkpy_vm_run(vm, "import math"));
check(pkpy_get_global(vm, "math")); check(pkpy_get_global(vm, "math"));

View File

@ -63,6 +63,13 @@ NameError: testing error throwing from python
successfully errored with this message: successfully errored with this message:
Traceback (most recent call last): Traceback (most recent call last):
_: test direct error mechanism _: test direct error mechanism
successfully errored with this message:
Traceback (most recent call last):
File "<c-bound>", line 1
test_nested_error()
File "<c-bound>", line 1
def error_from_python() : raise NotImplementedError()
NotImplementedError
pi: 3.14 pi: 3.14
pi: 3.14 pi: 3.14
2 2