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

Function print_python_error

src/python/plugin_runner.cpp:39–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 }
38
39 void print_python_error() {
40 if (PyErr_Occurred()) {
41 PyObject *type, *value, *traceback;
42 PyErr_Fetch(&type, &value, &traceback);
43 PyErr_NormalizeException(&type, &value, &traceback);
44
45 std::string msg = pyobj_to_string(value);
46 std::println(stderr, "Error: {}", msg);
47
48 Py_XDECREF(type);
49 Py_XDECREF(value);
50 Py_XDECREF(traceback);
51 }
52 }
53
54 } // anonymous namespace
55

Callers 1

run_plugin_commandFunction · 0.85

Calls 1

pyobj_to_stringFunction · 0.85

Tested by

no test coverage detected