MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / pyobj_to_string

Function pyobj_to_string

src/python/plugin_runner.cpp:29–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 };
28
29 std::string pyobj_to_string(PyObject* obj) {
30 if (!obj)
31 return "";
32 PyObjectGuard str(PyObject_Str(obj));
33 if (!str)
34 return "";
35 const char* c_str = PyUnicode_AsUTF8(str.get());
36 return c_str ? c_str : "";
37 }
38
39 void print_python_error() {
40 if (PyErr_Occurred()) {

Callers 1

print_python_errorFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected