From 83753405820bcf4884d78e116eb2f8f31c4151a7 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 7 Oct 2018 20:24:19 +0200 Subject: [PATCH] py_panda: fix TypeError being raised instead of AttributeError This prevented doing something like hasattr(vec3, "stuff") --- dtool/src/interrogatedb/py_panda.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index e900ab0e7f..42bcdb9a35 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/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'", 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; }