From 7de39b0cdaeb8fa50dfeeb07a72dc1b32fbe9c3e Mon Sep 17 00:00:00 2001 From: Kolten Pearson Date: Sat, 6 May 2023 19:31:48 -0600 Subject: [PATCH] switched to NameError for the type of error to use when a global can't be found --- c_bindings/pocketpy_c.cpp | 2 +- c_bindings/test_answers.txt | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/c_bindings/pocketpy_c.cpp b/c_bindings/pocketpy_c.cpp index e906c9f5..fd64ca6e 100644 --- a/c_bindings/pocketpy_c.cpp +++ b/c_bindings/pocketpy_c.cpp @@ -302,7 +302,7 @@ bool pkpy_get_global(pkpy_vm* vm_handle, const char* name) { if (o == nullptr) { o = vm->builtins->attr().try_get(name); if (o == nullptr) - vm->AttributeError("could not find requested global"); + vm->NameError("could not find requested global"); } vm->c_data->push(o); diff --git a/c_bindings/test_answers.txt b/c_bindings/test_answers.txt index 6a90c3ff..19d195d5 100644 --- a/c_bindings/test_answers.txt +++ b/c_bindings/test_answers.txt @@ -1,7 +1,6 @@ hello world! successfully errored with this message: -Traceback (most recent call last): -AttributeError: could not find requested global +NameError: name 'could not find requested global' is not defined testing int methods 11 @@ -50,6 +49,3 @@ TypeError: expected 2 positional arguments, but got 0 (x) testing pushing functions 12 -successfully errored with this message: -Traceback (most recent call last): -AttributeError: could not find requested global