@@ -24,7 +24,7 @@ PYBIND11_NAMESPACE_BEGIN(detail)
24
24
# define PYBIND11_SET_OLDPY_QUALNAME (obj, nameobj ) setattr((PyObject *) obj, " __qualname__" , nameobj)
25
25
#endif
26
26
27
- inline std::string get_tp_name (PyTypeObject *type) {
27
+ inline std::string get_fully_qualified_tp_name (PyTypeObject *type) {
28
28
#if !defined(PYPY_VERSION)
29
29
return type->tp_name ;
30
30
#else
@@ -180,7 +180,7 @@ extern "C" inline PyObject *pybind11_meta_call(PyObject *type, PyObject *args, P
180
180
for (const auto &vh : values_and_holders (instance)) {
181
181
if (!vh.holder_constructed ()) {
182
182
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 ());
184
184
Py_DECREF (self);
185
185
return nullptr ;
186
186
}
@@ -312,7 +312,7 @@ extern "C" inline PyObject *pybind11_object_new(PyTypeObject *type, PyObject *,
312
312
// / following default function will be used which simply throws an exception.
313
313
extern " C" inline int pybind11_object_init (PyObject *self, PyObject *, PyObject *) {
314
314
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!" ;
316
316
PyErr_SetString (PyExc_TypeError, msg.c_str ());
317
317
return -1 ;
318
318
}
@@ -451,7 +451,7 @@ extern "C" inline PyObject *pybind11_get_dict(PyObject *self, void *) {
451
451
extern " C" inline int pybind11_set_dict (PyObject *self, PyObject *new_dict, void *) {
452
452
if (!PyDict_Check (new_dict)) {
453
453
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_p_name (Py_TYPE (new_dict)).c_str ());
455
455
return -1 ;
456
456
}
457
457
PyObject *&dict = *_PyObject_GetDictPtr (self);
0 commit comments