Cast the record message to str() before extracting.

This commit is contained in:
Mikaël Capelle
2020-11-09 18:28:58 +01:00
parent 5f8e1803c0
commit c45bfb1e35
+1 -1
View File
@@ -23,7 +23,7 @@ void emit_function(bpy::object self, bpy::object record) {
// There are other parameters that could be used, but this is minimal for
// now (filename, line number, etc.).
const int level = bpy::extract<int>(record.attr("levelno"));
const std::wstring msg = bpy::extract<std::wstring>(record.attr("msg"));
const std::wstring msg = bpy::extract<std::wstring>(bpy::str(record.attr("msg")));
switch (level) {
case PyLogLevel::CRITICAL: