@@ -24,7 +24,7 @@ PYBIND11_NAMESPACE_BEGIN(detail)
2424# define PYBIND11_SET_OLDPY_QUALNAME (obj, nameobj ) setattr((PyObject *) obj, " __qualname__" , nameobj)
2525#endif
2626
27- inline std::string get_tp_name (PyTypeObject *type) {
27+ inline std::string get_fully_qualified_tp_name (PyTypeObject *type) {
2828#if !defined(PYPY_VERSION)
2929 return type->tp_name ;
3030#else
@@ -180,7 +180,7 @@ extern "C" inline PyObject *pybind11_meta_call(PyObject *type, PyObject *args, P
180180 for (const auto &vh : values_and_holders (instance)) {
181181 if (!vh.holder_constructed ()) {
182182 PyErr_Format (PyExc_TypeError, " %.200s.__init__() must be called when overriding __init__" ,
183- get_tp_name (vh.type ->type ).c_str ());
183+ get_fully_qualified_tp_name (vh.type ->type ).c_str ());
184184 Py_DECREF (self);
185185 return nullptr ;
186186 }
@@ -312,7 +312,7 @@ extern "C" inline PyObject *pybind11_object_new(PyTypeObject *type, PyObject *,
312312// / following default function will be used which simply throws an exception.
313313extern " C" inline int pybind11_object_init (PyObject *self, PyObject *, PyObject *) {
314314 PyTypeObject *type = Py_TYPE (self);
315- std::string msg = get_tp_name (type) + " : No constructor defined!" ;
315+ std::string msg = get_fully_qualified_tp_name (type) + " : No constructor defined!" ;
316316 PyErr_SetString (PyExc_TypeError, msg.c_str ());
317317 return -1 ;
318318}
@@ -451,7 +451,7 @@ extern "C" inline PyObject *pybind11_get_dict(PyObject *self, void *) {
451451extern " C" inline int pybind11_set_dict (PyObject *self, PyObject *new_dict, void *) {
452452 if (!PyDict_Check (new_dict)) {
453453 PyErr_Format (PyExc_TypeError, " __dict__ must be set to a dictionary, not a '%.200s'" ,
454- get_tp_name (Py_TYPE (new_dict)).c_str ());
454+ get_fully_qualified_tp_name (Py_TYPE (new_dict)).c_str ());
455455 return -1 ;
456456 }
457457 PyObject *&dict = *_PyObject_GetDictPtr (self);
@@ -479,8 +479,8 @@ extern "C" inline int pybind11_clear(PyObject *self) {
479479inline void enable_dynamic_attributes (PyHeapTypeObject *heap_type) {
480480 auto type = &heap_type->ht_type ;
481481#if defined(PYPY_VERSION) && (PYPY_VERSION_NUM < 0x06000000)
482- pybind11_fail (get_tp_type (type) + " : dynamic attributes are currently not "
483- " supported in conjunction with PyPy!" );
482+ pybind11_fail (get_fully_qualified_tp_name (type) + " : dynamic attributes are currently not "
483+ " supported in conjunction with PyPy!" );
484484#endif
485485 type->tp_flags |= Py_TPFLAGS_HAVE_GC;
486486 type->tp_dictoffset = type->tp_basicsize ; // place dict at the end
0 commit comments