From 63a9b5dfeca34d0ad06783958bfc98fddc64f1eb Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 1 Nov 2015 15:45:52 +0100 Subject: [PATCH] Re-expose MouseWatcherGroup; clearer error message for make_seq when getter is not exposed --- dtool/src/interrogate/interfaceMakerPythonNative.cxx | 2 +- panda/src/tform/mouseWatcherBase.cxx | 2 +- panda/src/tform/mouseWatcherGroup.h | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 5a2dd24e41..1d5520470c 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/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" diff --git a/panda/src/tform/mouseWatcherBase.cxx b/panda/src/tform/mouseWatcherBase.cxx index 6a5a92aa4c..559508029d 100644 --- a/panda/src/tform/mouseWatcherBase.cxx +++ b/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)"; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/tform/mouseWatcherGroup.h b/panda/src/tform/mouseWatcherGroup.h index d07994581d..bab2b497e1 100644 --- a/panda/src/tform/mouseWatcherGroup.h +++ b/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()); }