From 61cfd40824e43b91799253c3f574ca3032cc7904 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 3 Jun 2011 09:11:12 +0000 Subject: [PATCH] fix an oops --- panda/src/linmath/lvecBase3_ext_src.I | 6 +++++- panda/src/linmath/lvecBase4_ext_src.I | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/panda/src/linmath/lvecBase3_ext_src.I b/panda/src/linmath/lvecBase3_ext_src.I index fd0896da66..4306c42895 100644 --- a/panda/src/linmath/lvecBase3_ext_src.I +++ b/panda/src/linmath/lvecBase3_ext_src.I @@ -110,7 +110,11 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it < 'x' || *it > 'z') { - return NULL; + PyTypeObject *tp = self->ob_type; + PyErr_Format(PyExc_AttributeError, + "'%.100s' object has no attribute '%.200s'", + tp->tp_name, attr_name.c_str()); + return -1; } } #endif diff --git a/panda/src/linmath/lvecBase4_ext_src.I b/panda/src/linmath/lvecBase4_ext_src.I index d43d1aeff1..57001d158f 100644 --- a/panda/src/linmath/lvecBase4_ext_src.I +++ b/panda/src/linmath/lvecBase4_ext_src.I @@ -124,7 +124,11 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) { // Validate the attribute name. for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) { if (*it < 'w' || *it > 'z') { - return NULL; + PyTypeObject *tp = self->ob_type; + PyErr_Format(PyExc_AttributeError, + "'%.100s' object has no attribute '%.200s'", + tp->tp_name, attr_name.c_str()); + return -1; } } #endif