fix pyname for non default constructible classes

This commit is contained in:
Christopher Lackner 2019-09-11 15:17:09 +02:00
parent 9510670140
commit c359832767

View File

@ -21,8 +21,7 @@ namespace ngcore
struct PyNameTraits { struct PyNameTraits {
static const std::string & GetName() static const std::string & GetName()
{ {
static const std::string name = static const std::string name = typeid(T).name();
py::cast<std::string>(py::cast(T()).attr("__class__").attr("__name__"));
return name; return name;
} }
}; };