Browse Source

switched to using vm->AttributeError for missing global

Kolten Pearson 2 years ago
parent
commit
dd2212fbad
1 changed files with 1 additions and 1 deletions
  1. 1 1
      c_bindings/pocketpy_c.cpp

+ 1 - 1
c_bindings/pocketpy_c.cpp

@@ -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)
-            throw Exception("AttributeError", "could not find requested global");
+            vm->AttributeError("could not find requested global");
     }
     }
 
 
     vm->c_data->push(o);
     vm->c_data->push(o);