mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-24 17:38:14 +00:00
Revert "Extract exception name via tp_name"
The implementation of __name__ is slightly more complex than that.
It handles the module name prefix, and heap-allocated types. We could
port it to pybind11 later on but for now it seems like an overkill.
This reverts commit f1435c7e6b
.
This commit is contained in:
parent
60df1435dd
commit
c935b73ba5
@ -413,7 +413,7 @@ PYBIND11_NOINLINE inline std::string error_string(PyObject* type, PyObject* valu
|
|||||||
// normalized by the caller?
|
// normalized by the caller?
|
||||||
std::string errorString;
|
std::string errorString;
|
||||||
if (type) {
|
if (type) {
|
||||||
errorString += static_cast<const std::string>(reinterpret_cast<PyTypeObject*>(type)->tp_name);
|
errorString += handle(type).attr("__name__").cast<std::string>();
|
||||||
errorString += ": ";
|
errorString += ": ";
|
||||||
}
|
}
|
||||||
if (value)
|
if (value)
|
||||||
|
Loading…
Reference in New Issue
Block a user