Browse Source

py_panda: fix TypeError being raised instead of AttributeError

This prevented doing something like hasattr(vec3, "stuff")
rdb 7 years ago
parent
commit
8375340582
1 changed files with 2 additions and 2 deletions
  1. 2 2
      dtool/src/interrogatedb/py_panda.cxx

+ 2 - 2
dtool/src/interrogatedb/py_panda.cxx

@@ -235,8 +235,8 @@ PyObject *Dtool_Raise_AttributeError(PyObject *obj, const char *attribute) {
     "'%.100s' object has no attribute '%.200s'",
     "'%.100s' object has no attribute '%.200s'",
     Py_TYPE(obj)->tp_name, attribute);
     Py_TYPE(obj)->tp_name, attribute);
 
 
-  Py_INCREF(PyExc_TypeError);
-  PyErr_Restore(PyExc_TypeError, message, nullptr);
+  Py_INCREF(PyExc_AttributeError);
+  PyErr_Restore(PyExc_AttributeError, message, nullptr);
   return nullptr;
   return nullptr;
 }
 }