Browse Source

fix an oops

rdb 14 years ago
parent
commit
61cfd40824
2 changed files with 10 additions and 2 deletions
  1. 5 1
      panda/src/linmath/lvecBase3_ext_src.I
  2. 5 1
      panda/src/linmath/lvecBase4_ext_src.I

+ 5 - 1
panda/src/linmath/lvecBase3_ext_src.I

@@ -110,7 +110,11 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it < 'x' || *it > 'z') {
     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
 #endif

+ 5 - 1
panda/src/linmath/lvecBase4_ext_src.I

@@ -124,7 +124,11 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it < 'w' || *it > 'z') {
     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
 #endif