Browse Source

Re-expose MouseWatcherGroup; clearer error message for make_seq when getter is not exposed

rdb 10 years ago
parent
commit
63a9b5dfec

+ 1 - 1
dtool/src/interrogate/interfaceMakerPythonNative.cxx

@@ -6121,7 +6121,7 @@ write_make_seq(ostream &out, Object *obj, const std::string &ClassName,
       << "\n"
       << "  PyObject *getter = PyDict_GetItemString(Dtool_" << ClassName << "._PyType.tp_dict, \"" << element_name << "\");\n"
       << "  if (getter == (PyObject *)NULL) {\n"
-      << "    return NULL;\n"
+      << "    return Dtool_Raise_AttributeError(self, \"" << element_name << "\");\n"
       << "  }\n"
       << "\n"
       << "  Py_ssize_t count = (Py_ssize_t)local_this->" << make_seq->_num_name << "();\n"

+ 1 - 1
panda/src/tform/mouseWatcherBase.cxx

@@ -218,7 +218,7 @@ get_region(int n) const {
 ////////////////////////////////////////////////////////////////////
 void MouseWatcherBase::
 output(ostream &out) const {
-  out << "MouseWatcherBase (" << _regions.size() << " regions)";
+  out << "MouseWatcherGroup (" << _regions.size() << " regions)";
 }
 
 ////////////////////////////////////////////////////////////////////

+ 6 - 2
panda/src/tform/mouseWatcherGroup.h

@@ -31,13 +31,17 @@ class EXPCL_PANDA_TFORM MouseWatcherGroup : public MouseWatcherBase,
 public:
   INLINE MouseWatcherGroup() {};
 
-public:
+PUBLISHED:
   static TypeHandle get_class_type() {
-    ReferenceCount::init_type();
     return _type_handle;
   }
+
+public:
   static void init_type() {
+    MouseWatcherBase::init_type();
+    ReferenceCount::init_type();
     register_type(_type_handle, "MouseWatcherGroup",
+                  MouseWatcherBase::get_class_type(),
                   ReferenceCount::get_class_type());
   }