MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / PyUnicodeToStdString

Function PyUnicodeToStdString

oneflow/extension/stack/python/stack_getter.cpp:48–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47namespace {
48std::string PyUnicodeToStdString(const PyObject* py_str) {
49 return PyBytes_AsString(PyUnicode_AsEncodedString(const_cast<PyObject*>(py_str), "utf-8", "~E~"));
50}
51#if PY_VERSION_HEX < 0x03090000
52PyCodeObject* PyFrame_GetCode(PyFrameObject* frame) {
53 assert(frame != NULL);

Callers 3

GetFormattedStackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected