mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
switched to NameError for the type of error to use when a global can't
be found
This commit is contained in:
parent
dd2212fbad
commit
7de39b0cda
@ -302,7 +302,7 @@ bool pkpy_get_global(pkpy_vm* vm_handle, const char* name) {
|
|||||||
if (o == nullptr) {
|
if (o == nullptr) {
|
||||||
o = vm->builtins->attr().try_get(name);
|
o = vm->builtins->attr().try_get(name);
|
||||||
if (o == nullptr)
|
if (o == nullptr)
|
||||||
vm->AttributeError("could not find requested global");
|
vm->NameError("could not find requested global");
|
||||||
}
|
}
|
||||||
|
|
||||||
vm->c_data->push(o);
|
vm->c_data->push(o);
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
hello world!
|
hello world!
|
||||||
successfully errored with this message:
|
successfully errored with this message:
|
||||||
Traceback (most recent call last):
|
NameError: name 'could not find requested global' is not defined
|
||||||
AttributeError: could not find requested global
|
|
||||||
|
|
||||||
testing int methods
|
testing int methods
|
||||||
11
|
11
|
||||||
@ -50,6 +49,3 @@ TypeError: expected 2 positional arguments, but got 0 (x)
|
|||||||
|
|
||||||
testing pushing functions
|
testing pushing functions
|
||||||
12
|
12
|
||||||
successfully errored with this message:
|
|
||||||
Traceback (most recent call last):
|
|
||||||
AttributeError: could not find requested global
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user